In order to use the
grunt command, you will need to install Grunt's command-line interface (CLI) globally on your system. Open a terminal and execute the following command:
$ npm install -g grunt-cli
The preceding command will download and install
grunt-cli on your system and wire up the
grunt command in your system path. This does not install the Grunt task runner; the CLI is only responsible for running the version of Grunt that is specified in a project's
package.json file relative to the
Gruntfile.js file. This enables different projects to use different versions of Grunt without getting affected.
–g flag generally requires an administrator user.
The easiest way to add Grunt to your project is ...