Install Node.js & NPM
Before installing grunt you need to install node.js on your system first. Use following set of commands to add node.js ppa in your Ubuntu system and install node.js
# sudo apt-get install python-software-properties
# curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
# sudo apt-add-repository ppa:chris-lea/node.js
# sudo apt-get update
# sudo apt-get install nodejs
To Make sure that node.js has installed successfully, execute the following command:
# node --version
# npm --version
Install Grunt using NPM
Now use following command to install grunt and grunt cli using npm in your Ubuntu system.
# sudo npm install -g grunt
# sudo npm install -g grunt-cli
After successful installation make sure grunt has been installed successful and check version.
# grunt --version