How to Install Grunt & Grunt-cli on Ubuntu
By Anuket Jain On 10 August 2016 In Linux
Grunt is a Javascript task runner that can be used to compile Sass, run JSHint, or run many other plugins. Grunt has a long list of plugin to perform tasks provided by its community. It depends on the Node.js package manager, npm. In this article we will explain how to install Grunt & Grunt-cli on Ubuntu.
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
v6.3.1
# npm --version
3.10.3
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
grunt-cli v1.2.0
Enjoy it!