grunt: command not found when running from terminal

后端 未结 6 1740
礼貌的吻别
礼貌的吻别 2020-12-23 08:58

I\'m new to Grunt. I\'m trying to configure Grunt on my Mac OSX Lion.

I followed the instructions here and then created a project folder that contains the files bel

6条回答
  •  梦毁少年i
    2020-12-23 09:34

    the key point is finding the right path where your grunt was installed. I installed grunt through npm, but my grunt path was /Users/${whoyouare}/.npm-global/lib/node_modules/grunt/bin/grunt. So after I added /Users/${whoyouare}/.npm-global/lib/node_modules/grunt/bin to ~/.bash_profile,and source ~/.bash_profile, It worked.

    So the steps are as followings:

    1. find the path where your grunt was installed(when you installed grunt, it told you. if you don't remember, you can install it one more time)

    2. vi ~/.bash_profile

    3. export PATH=$PATH:/your/path/where/grunt/was/installed

    4. source ~/.bash_profile

    You can refer http://www.hongkiat.com/blog/grunt-command-not-found/

提交回复
热议问题