Grunt from the command prompt in Windows

Posted by on May 20, 2015 in JavaScript

If you’re planning to play about with Grunt on Windows any time soon, chances are you’ll find a tutorial online which tells you to install grunt globally as follows:

This will run just fine, but when you next run grunt you’ll get the lovely error:

Whats going on here then?
Turns out Grunt itself is no longer installed globally, but its command line interface (CLI) is. The CLI is simply there as a GLOBAL means of launching a locally provisioned grunt.
Therefore all you need to do is amend the command to:

that way, the next time you run

from the command line, the CLI will invoke the locally installed grunt instance and you should be good to go.
If in doubt, just follow the official grunt.js getting started guide