grunt-cli installation issue

3.3k Views Asked by At

I installed grunt-cli both locally and globally and I can see the same in both local and global paths.

To test if the installation works, when I tried to run

grunt -h

it shows following

    >> Local Npm module "grunt-cli" not found. Is it installed?

    Grunt: The JavaScript Task Runner (v0.4.5)

    Usage
     grunt [options] [task [task ...]]

    Options
     --help, -h  Display this help text.
     --base  Specify .......

When I run grunt -v, following is part of its output

Registering "grunt-cli" local Npm module tasks.
Reading /Users/cominventor/myproject/node_modules/grunt-cli/package.json...OK
Parsing /Users/cominventor/myproject/node_modules/grunt-cli/package.json...OK
>> Local Npm module "grunt-cli" not found. Is it installed?

To install locally, I ran the following command (suggested by @Aruna)

npm install grunt --save-dev
npm install grunt-cli --save-dev

and got the following output for the second command

npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "grunt-cli" "--save-dev"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.7
npm ERR! code ENOSELF

npm ERR! Refusing to install grunt-cli as a dependency of itself
npm ERR!

Any clues what am I missing here?

1

There are 1 best solutions below

10
AudioBubble On

How did you install the grunt?

Have you tried both global and local modules as below,

Global

npm install -g grunt-cli 

Local

npm install grunt --save-dev
npm install grunt-cli --save-dev