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?
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.
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.
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.
npm install -g grunt-cli => This will put the grunt command in your system path
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With