【问题标题】:NPM run watch errorsNPM 运行监视错误
【发布时间】:2018-07-18 11:29:47
【问题描述】:

有人知道我要在这里做什么吗?

    npm ERR! Linux 4.4.0-17134-Microsoft
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path /package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

我测试了 npm,运行版本 3.5.2。但我不能使用 npm 中的任何东西。

【问题讨论】:

    标签: npm npm-install npm-start


    【解决方案1】:

    您没有正确的 package.json 文件,这就是您无法运行此命令的原因。您可以手动创建此文件,或者(更好)运行

    npm init
    

    创建这个文件。在此之后,您应该使用

    安装所有 npm 包
    npm install.
    

    您可以将此包添加到 package.json,或者单独安装它们,使用

    npm i ... package name --save.
    

    在此之后,您可以运行 npm run start,但前提是您在 package.json 的“脚本”部分中预定义了这个并定义了这个脚本应该做什么。

    【讨论】:

      猜你喜欢
      • 2018-05-11
      • 2018-07-21
      • 2021-07-14
      • 1970-01-01
      • 2021-09-04
      • 2019-12-17
      • 2018-06-29
      • 2018-08-07
      • 2018-10-03
      相关资源
      最近更新 更多