Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Grunt

I used Homebrew to install Node.js, then used npm install to install Grunt and its dependencies, but after the installation completed, I was not able to run Grunt:

zsh: correct 'grunt' to 'grn' ÆnyaeÅ? n
zsh: command not found: grunt

What is the proper method of installing Grunt so I do not get this error?

like image 905
sottish Avatar asked Sep 22 '13 04:09

sottish


People also ask

How do I download grunt from command-line?

Installing the CLI. Run sudo npm install -g grunt-cli (Windows users should omit "sudo ", and may need to run the command-line with elevated privileges). The grunt command-line interface comes with a series of options. Use grunt -h from your terminal to show these options.

What is npm grunt?

Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file (known as a Gruntfile). Grunt was created by Ben Alman and is written in Node. js.


2 Answers

To use Grunt on the command line, you have to install the command-line interface:

npm install -g grunt-cli

The -g flag is for installing the module globally, which will also create a PATH variable for Grunt.

like image 170
hexacyanide Avatar answered Sep 20 '22 03:09

hexacyanide


npm install -g grunt-cli   => This will put the grunt command in your system path
like image 31
Deepak Avatar answered Sep 19 '22 03:09

Deepak