Windows: 'grunt' is not recognized as an internal or external command
When I npm install -g grunt, grunt is not adding a binary to C:\Documents and Settings\apenneba\npm\. The result is that attempts to run grunt in Command Prompt fail with:
'grunt' is not recognized as an internal or external command
System:
I repeated npm install -g grunt, grunt in Command Prompt as well as Git Bash. In either case, grunt fails to add itself to PATH.
Other packages like mocha, jshint, nodeunit, and tap are successfulling adding themselves to PATH.
$ specs node git os
Specs:
specs 0.4
https://github.com/mcandre/specs#readme
npm --version
1.2.17
node --version
v0.10.3
git --version
git version 1.8.0.msysgit.0
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 3 Build 2600
See the getting started guide http://gruntjs.com/getting-started grunt is no longer installed globally
@nschonni Just beat me to it :) npm install -g grunt-cli
@shama, @nschonni Thanks! Works for me!
Hey Thanks shama,, It worked for me as well :)
This popped up again to me :(
Doesn't work for me. Installed it via npm install -g grunt-cli, as administrator and via my user account. Didn't work either way.
@tomasdev @schlingel Make sure the path to node is correctly configured. Try node -v and it should display the version of node you're running. If that works and you've npm install grunt-cli -g then try where grunt to see if you can find it on Windows.
@shama I did all of the above steps but when i run "where grunt" command it says where is not recognized command
I did all of the above steps, but had to add the following to the PATH environment variable on Windows 7 in a Domain %USERPROFILE%\AppData\Roaming\npm
@mhanney, that could be related to a year-old issue I filed on the Node.js installer: joyent/node#4228.
Had the same problem and running following command in the shell solves it path=%PATH%;%APPDATA%\npm
path=%PATH%;%APPDATA%\npm Works for me. The only problem I have is that I have to use this every time I restart my machine.
thank you thank you thank you path=%PATH%;%APPDATA%\npm worked for me too
Try echo ~ for the path ;)
Same problem, but solved by @mhanney's suggestion, I just added that line to my environment variables and now grunt is recognized by the command line.
need to reboot computer after config environment variable.
need to reboot computer after config environment variable.
Also in some cases just reopening CMD works.
Worked. Thanks @shama and @nschonni.
@andi69 thanks! that was frustrating...
npm installs executables to: npm config get prefix
on windows7 it's %AppData%\npm, though adding %AppData%\npm to %PATH% doesn't work.
Instead add this to %PATH%:
%USERPROFILE%\AppData\Roaming\npm