【问题标题】:npm start fails to runnpm start 无法运行
【发布时间】:2021-01-25 17:34:36
【问题描述】:

为什么当我重新启动 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$ 

screenshot

【问题讨论】:

    标签: npm npm-start


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      从错误日志中可以清楚地看出该文件夹不包含 package.json。确保从包含 package.json 的文件夹运行脚本 npm run start。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-11-28
        • 1970-01-01
        • 2017-10-05
        • 2020-06-23
        • 2020-09-23
        • 1970-01-01
        • 2021-10-03
        • 2016-05-02
        相关资源
        最近更新 更多