skip to Main Content

Im working with a react project and everytime I try and install a package I get this error. It could be something simple, this is my first time working outside of a online learning platform. This is the error

found 0 vulnerabilities
julianvazquez@Julians-MacBook-Pro-2 2jujuport % npm start
npm ERR! Missing script: "start"
npm ERR! 
npm ERR! Did you mean one of these?
npm ERR!     npm star # Mark your favorite packages
npm ERR!     npm stars # View packages marked as favorites
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: /Users/julianvazquez/.npm/_logs/2023-10-24T03_48_30_410Z-debug-0.log
julianvazquez@Julians-MacBook-Pro-2 2jujuport % npm run 
Scripts available in [email protected] via `npm run-script`:
  dev
    vite
  build
    vite build
  preview
    vite preview

Please help :/

I thought maybe the file was corrupted so I tried importing them in several diffferent projects but was still getting the same error. The latest attempt was a project that I downloaded and opened up on my own device. I still got the same error, after installing all dependences, make sure everything was upto date, etc.

2

Answers


  1. if its vite project, then use npm run dev I think, not npm start
    npm start is for normal react project and if you build a react project using vite you should use npm dev run
    also please provide the folder structure and package.json file for more clarity for us

    Login or Signup to reply.
  2. It looks like your project is set up with Vite, for which, you need to run the npm run dev command. npm start usually comes with a create-react-app project.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search