Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can not install grunt with npm command line

Tags:

gruntjs

my node version is v6.6.0. my npm version is v4.0.5.

using npm ls -g already found grunt-cli has been installed

however, when I use npm install grunt -save-dev it show

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

I have check this simple issue for two hours. but it does not solve. thanks

like image 989
Courage Avatar asked Nov 29 '25 20:11

Courage


2 Answers

I have resolved this issue, because my package.json name is same with the grunt name. thanks stackoverflow space.

like image 69
Courage Avatar answered Dec 02 '25 03:12

Courage


The issue is in your package.json file. You should change the name.

In "name": "grunt", set grunt to something else and it should work perfectly.

like image 30
Seth Connell Avatar answered Dec 02 '25 04:12

Seth Connell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!