I'm suddenly having a problem with "npm start" in my React application. When I trigger it, this is what I receive

41 views Asked by At
Happy hacking!
crossdu@Kens-MacBook-Pro test-4 % npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/crossdu/visual studio code /untitled folder/pricing-card-official/test-4/package.json
npm ERR! errno -2
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/Users/crossdu/visual studio code /untitled folder/pricing-card-official/test-4/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in: /Users/crossdu/.npm/_logs/2024-03-26T21_33_27_101Z-debug-0.log

I have No reason why this is not working I tried to

  • Upgrade npm (sudo npm install -g npm)
  • Clear the global npm cache (sudo npm cache clear)
  • Clear the user npm cache (npm cache clear)

but none of them works and I am using macbook

1

There are 1 answers

2
mfusco On

I found a similar problem here: Start script missing error when running npm start

Try this:

npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app my-app

Also, make sure your package.json file is in the proper directory.