• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Install Grunt and Grunt-cli on Ubuntu 16.04

{{postValue.id}}

To Install Grunt and Grunt-cli on Ubuntu 16.04

Grunt is a JavaScript task runner, which helps in performing repetitive tasks like compilation, unit testing, and linting. This means that a developer can save time and spend it doing more useful development work. It is so simple to install both Grunt and Grunt-cli on Ubuntu 16.04, and this tutorial sheds light on the same process. 


Installing Grunt

Grunt and Grunt plugins are installed and managed via the Node.js package manager, npm. So, the first thing to do is install Node.js. Node.js is available in the Ubuntu repository, with its required dependencies. You can install Node.js with the help of the following command.

root@linuxhelp:~# apt install nodejs npm
Reading package lists... Done
Building dependency tree     
.
Setting up npm (3.5.2-0ubuntu4) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...

 

 

And then, check if npm is up to date and running in your system.

root@linuxhelp:~# npm update -g npm

 

At this point, it’ s possible to install Grunt and its CLI. Both of them can be installed by making use of the following command.

root@linuxhelp:~# npm -g install grunt
npm WARN deprecated coffee-script@1.10.0: CoffeeScript on NPM has moved to " coffeescript"  (no hyphen)
/usr/local/bin/grunt ->  /usr/local/lib/node_modules/grunt/bin/grunt
.
+-- path-is-absolute@1.0.1 
  `--  rimraf@2.2.8

 

root@linuxhelp:~# npm -g install grunt-cli
loadDep:path-is-absolute   |####################-------------------------------------------------------------------------
.
.
+-- nopt@3.0.6 
  | `-- abbrev@1.1.1 
  `-- resolve@1.1.7  

 

A Grunt setup involves adding package.json and Gruntfile to the project. So, let us create a new project to test that. Create a new folder first, by making use of the following command.

root@linuxhelp:~# mkdir ~/grunt_project

 

 

In this folder, you need to execute this action.

root@linuxhelp:~# npm init 
This utility will walk you through creating a package.json file.
.
Use `npm install < pkg>  --save` afterwards to install a package and
save it as a dependency in the package.json file.

Then, you should give all the essential information about the project name, author, a git repository, version, etc.  And then, you need to Enter and it will create a package.json file with all of the information you entered.

With this, the installation of  Grunt and Grunt-cli on Ubuntu 16.04 comes to an end. 

Tags:
jackson
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is the usage of grunt?

A

Grunt is a JavaScript task runner, which helps in performing repetitive tasks like compilation, unit testing, and linting.

Q

What was its required packages ?

A

nodejs , npm are its major dependencies

Q

What version node is used here?

A

node version of 6.10.3

Q

what is the permission for the grunt-cli?

A

this are the grunt-cli permission below,
$ sudo chown -R vagrant:vagrant /usr/lib/node_modules
$ sudo chown -R vagrant:vagrant /home/vagrant/.npm

Q

How to enable tab auto-completion for Grunt, add one of the following lines to your ~/.bashrc or ~/.zshrc file?

A

Run the following command,
# Bash, ~/.bashrc
eval "$(grunt --completion=bash)"
# Zsh, ~/.zshrc
eval "$(grunt --completion=zsh)"

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.