Installing Grunt on mac os

I want to create angular js app using bootstrap, for this I have installed node.js pkg file in my mac. Afterwards I installed yoman ( $sudo npm install --global yo

). The documentation says that if we install yo then we get grunt and bower automatically. In my case grunt and bower are not installed.

So I decided to install it externally. I used the following commands:

$sudo npm install -g bower

=> it works great and gives me all files and packages.

$ sudo npm install -g grunt

=> it works fine but doesn't give me all files and packages

grunt are installed in the path usr/local/lib/node_modules/grunt

grunt folder contains files

constributing.md
licenses-mit
readme
aaveyor.yml
internal-tasks
lib
node_modules
package.json

      

What files am I missing?

If I run the command $ grunt --version

then I got the following error

-bash: /grunt: No such file or directory

      

How do I resolve this?

+3


source to share


1 answer


You need to run:

$ npm install -g grunt-cli

      

Global binary command line tool grunt-cli

, not grunt

. This is a little confusing at the beginning as it grunt-cli

provides a global binary that can be called grunt

.



So at the end:

  • Install grunt

    locally in your application.
  • Install grunt-cli

    globally.

Then you can run grunt

from anywhere :-)

+5


source







All Articles