npm start fails to run

会有一股神秘感。 提交于 2021-01-29 07:28:05

问题


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


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/64300327/npm-start-fails-to-run

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!