Prerequesites

Grunt requires Node.js and npm to be installed. If you don’t have Node.js and/or npm installed on your machine, go to https://nodejs.org and download the installer or package for your operating system.

First-time install

If you’re installing Grunt for the first time, you’ll first have to install the Grunt command-line interface package grunt-cli globally.

npm install -g grunt-cli

This installs the command-line interface for Grunt globally so you can run the local version of Grunt in your project.

You can verify that you have grunt-cli package installed by running the following command:

grunt --version

This should print at least the current version of your grunt-cli package.

Installing Grunt in your project

After you have grunt-cli up and running, you can install the actual grunt task runner and your first Grunt package grunt-contrib-jshint: