How to Install Grunt on Ubuntu?


Grunt (The JavaScript assignment Runner) is an automation tool to perform repetitive duties like compilation, unit testing etc. Grunt and Grunt plugins are hooked up and managed through NPM, the Node.Js package manager. This article explains about – How to install Grunt on Ubuntu.

To install grunt on ubuntu, it should require pre-installed Node.js and NPM. To verify the version of Node.js, use the following command –

$ node --version

The sample output should be like this –

v6.9.2

To verify the version of NPM, use the following command –

$ npm --version

The sample output should be like this –

3.10.9

If you wants to install Node.js and NPM, read this article

To install grunt, use the following command –

$ sudo npm install -g grunt-cli

The sample output should be like this –

/usr/bin/grunt -> /usr/lib/node_modules/grunt-cli/bin/grunt
/usr/lib
      `-- grunt-cli@1.2.0
      +-- findup-sync@0.3.0
      | `-- glob@5.0.15
      |  +-- inflight@1.0.6
      |  | `-- wrappy@1.0.2
      |  +-- inherits@2.0.3
      |  +-- minimatch@3.0.3
      |  | `-- brace-expansion@1.1.6
      |  | +-- balanced-match@0.4.2
      |  | `-- concat-map@0.0.1
      | +-- once@1.4.0
      | `-- path-is-absolute@1.0.1
      +-- grunt-known-options@1.1.0
      +-- nopt@3.0.6
      | `-- abbrev@1.0.9
      `-- resolve@1.1.7

To verify the version of grunt, use the following command –

$ grunt --version

The sample output should be like this –

grunt-cli v1.2.0

In the above article, we have learnt – How to Install Grunt on Ubuntu. In our next articles, we will come up with more Linux based tricks and tips. Keep reading!

Sharon Christine
Sharon Christine

An investment in knowledge pays the best interest

Updated on: 22-Jan-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements