Grunt (The JavaScript Task Runner) is an automation tool to perform repetitive tasks like compilation, unit testing etc. Grunt has a long list of the plugin to perform tasks provided by its community. In this tutorial, you will learn how to install Grunt & Grunt-cli on Ubuntu 19.04, 18.04 LTS, 16.04 LTS and LinuxMint 9/8 systems.
1. Install Node.js & NPM
If you already have node.js and npm installed on your system skip this step. Else you need to install node.js on your system first. Use the following set of commands to add node.js PPA in your Ubuntu system and install it.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install nodejs
Make sure you have successfully installed node.js and npm on your system
node --version npm --version
2. Install Grunt using NPM
Now use the following command to install grunt and grunt CLI using npm command-line utility.
sudo npm install -g grunt
After successful installation makes sure grunt has been installed successful and check the version.
grunt --version grunt-cli v1.2.0
1 Comment
npm shouldn’t run using sudo .
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally