0

I'm trying to install grunt globally using the following command from the command line:

npm install -g grunt

The installation command seems to succeed with no errors written to the console. However, when I enter grunt at the command line after install I get the following error:

'grunt' is not recognized as an internal or external command, operable program or batch file

It looks like the install command installs grunt into the following directory by default:

c:\users\my_login_id\appdata\roaming\npm\node_modules\grunt

Not sure if the user-specific install directory might have anything to do with the issue? Any idea what might be causing the problem or how to debug?

random512
  • 1,017
  • 3
  • 13
  • 19
  • Almost always the problem in this case is related to paths. Is the `appdata\roaming\npm\node_modules` in your `PATH`? If not...adding it will likely be the solution. – Matthew Bakaitis Aug 07 '14 at 19:59
  • possible duplicate of [Grunt on Windows 8: 'grunt' is not recognized](http://stackoverflow.com/questions/19135561/grunt-on-windows-8-grunt-is-not-recognized) – Matthew Bakaitis Aug 07 '14 at 20:00

1 Answers1

2

You don't need to install grunt globally. I suggest you make grunt a dependency of your project. That way anyone can execute a npm install and get grunt. If you want to use the terminal commands, then you must install the command line interface package

Use:

npm install -g grunt-cli
Jordan Papaleo
  • 1,463
  • 11
  • 24