无法使用 npm 命令行安装 grunt
can not install grunt with npm command line
我的节点版本是v6.6.0。
我的 npm 版本是 v4.0.5.
使用 npm ls -g 已经发现 grunt-cli 已经安装
然而,当我使用 npm install grunt -save-dev 时它显示
SuoYong:grunt suoyong$ npm install grunt --save-dev
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/Cellar/node/6.6.0/bin/node" "/usr/local/bin/npm" "install" "grunt" "--save-dev"
npm ERR! node v6.6.0
npm ERR! npm v4.0.5
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "grunt" under a package
npm ERR! also called "grunt". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR! <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>
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! /Users/suoyong/Node/grunt/npm-debug.log
这个简单的问题我查了两个小时。但它没有解决。
谢谢
我已经解决了这个问题,因为我的 package.json 名字和 grunt 名字一样。感谢 Whosebug space.
问题出在您的 package.json 文件中。您应该更改名称。
在 "name": "grunt"
中,将 grunt 设置为其他内容,它应该可以完美运行。
我有同样的问题。我重命名了文件夹(我 运行 GitBash 的文件夹)名称并修复了。
文件夹的名称是 "grunt" ,我更改了它 "grunt-typescript" 并重试
- npm 安装 g运行t --save
我工作了! :)
我的节点版本是v6.6.0。 我的 npm 版本是 v4.0.5.
使用 npm ls -g 已经发现 grunt-cli 已经安装
然而,当我使用 npm install grunt -save-dev 时它显示
SuoYong:grunt suoyong$ npm install grunt --save-dev
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/Cellar/node/6.6.0/bin/node" "/usr/local/bin/npm" "install" "grunt" "--save-dev"
npm ERR! node v6.6.0
npm ERR! npm v4.0.5
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "grunt" under a package
npm ERR! also called "grunt". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR! <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>
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! /Users/suoyong/Node/grunt/npm-debug.log
这个简单的问题我查了两个小时。但它没有解决。 谢谢
我已经解决了这个问题,因为我的 package.json 名字和 grunt 名字一样。感谢 Whosebug space.
问题出在您的 package.json 文件中。您应该更改名称。
在 "name": "grunt"
中,将 grunt 设置为其他内容,它应该可以完美运行。
我有同样的问题。我重命名了文件夹(我 运行 GitBash 的文件夹)名称并修复了。 文件夹的名称是 "grunt" ,我更改了它 "grunt-typescript" 并重试
- npm 安装 g运行t --save
我工作了! :)