首页 > 解决方案 > npm start 无法运行

问题描述

为什么当我重新启动 MacBook 时 npm start 无法运行?有没有我之前必须运行的代码?请帮忙。

这是我每次尝试时得到的结果......

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$ 

截屏

标签: npmnpm-start

解决方案


npm start触发 package.json 中的启动脚本。根据错误消息,您的文件夹不包含 package.json 文件。


推荐阅读