About
Grunt is a NodeJS plugin that helps you automate many development routines. Further instruction contains Windows examples but it would work for Linux and MacOS as well. The only difference – NodeJS installation process.
Install NodeJS
Go to nodejs website and download the latest stable version of NodeJS.
Run NodeJS installer. Make sure NodeJS Package Manager (aka NPM) is enabled during the installation process.
Verify that NodeJS and NPM are installed properly.
Installation process
You can install it with NPM. NPM packages can be installed in two modes: global and local.
Global packages are installed in %nodejs_installation_path%/node_modules/ directory. Such packages are added to system PATH variable. You can use them from any working directory.
Locally installed packages are stored in %your_project_directory%/node_modules/ folder. They are accessible only from the project directory.
Grunt is a package that should be installed locally. Of course you can install it globally but it wouldn’t work.
Installation with npm is pretty simple. Just go to the project directory and run npm install command:
cd %your_project_directory% npm install grunt-cli grunt
Conclusion
Now you have grunt installed in your project. Check other posts to find out how to use it.