是nodeJS的新手,我试图将express作为一个依赖项来安装,但是它给了我以下错误::
C:\wamp\www\ExpressJS\node>npm install express --save
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "express" "--save"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! code ENOSELF
npm ERR! Refusing to install express as a dependency of itself
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\wamp\www\ExpressJS\node\npm-debug.log
**any help would be much appericiated, This is my npm-debug file**发布于 2017-10-09 06:52:39
我知道你的确切问题是什么,也就是,在创建这个项目的时候
npm init
您已经将该名称命名为依赖项名称。
因此,通过进入package.json并给出一个不同的名称,可以更改项目的名称。然后按照相同的命令重新安装,如下所示
npm安装--保存
我可以说你不会再犯同样的错误了
发布于 2016-01-19 21:36:52
您正在运行npm i express --save,位于ExpressJS文件夹中。请到外面去安装express。
发布于 2016-01-20 06:29:34
启动节点项目时,需要在目标文件夹中使用命令npm init。然后安装快件。
https://stackoverflow.com/questions/34884633
复制相似问题