npm start fails to run

113 Views Asked by At

why does npm start fails to run whenever I restart my MacBook? Is there any code that I would have to run before? Please help.

This is the results I get whenever I try....

Debugger attached.
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/somprey/Desktop/demo/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/somprey/Desktop/demo/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:
npm ERR!     /Users/somprey/.npm/_logs/2020-10-11T03_08_40_658Z-debug.log
Waiting for the debugger to disconnect...
SYLVESTERs-MBP:demo somprey$ 

screenshot

2

There are 2 best solutions below

0
On

npm start triggers the start script inside package.json. As per the error message, your folder doesnt contain the package.json file.

0
On

It is clear from the error log that the folder not contains the package.json. make sure you are running the script npm run start from the folder which contain package.json.