NPM运行监视错误

时间:2018-07-18 11:29:48

标签: npm npm-install npm-start

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

    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中的任何内容。

1 个答案:

答案 0 :(得分:0)

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

npm init

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

安装所有npm软件包。
npm install.

您可以将此软件包添加到package.json,或使用

单独安装
npm i ... package name --save.

此后,您可以运行npm run start,但仅当在package.json的“脚本”部分中预定义了该脚本并定义该脚本应该执行的操作时。

相关问题