NPM运行监视错误



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

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

您没有合适的package.json文件,这就是为什么,您不能运行此命令。你可以手动创建这个文件,或者(更好(运行

npm init

以创建此文件。在此之后,您应该使用安装所有的npm软件包

npm install.

您可以将这些包添加到package.json中,也可以使用单独安装

npm i ... package name --save.

之后,您可以运行npm run start,但只有当您在package.json的"scripts"部分中预定义了这个并定义了这个脚本应该做什么时。

相关内容

最新更新