Bower, Grunt & zsh: command not found:

a 夏天 提交于 2019-12-03 07:10:11

问题


I have installed Grunt & Bower & I'm using ZSH.

when I type bower --help or grunt anything I get zsh: command not found: bower or zsh: command not found: grunt how can I fix this?


回答1:


Add /usr/local/share/npm/bin/ to your $PATH environment




回答2:


I couldn't get the above to work. Problem was that I had just reinstalled my Mac and forgotten to re-install grunt.

You can test that grunt is actually installed and working properly outside of zshell by going back to bash with bash -l and running grunt.

If grunt is throwing the same error you can install grunt by running:

sudo npm install -g grunt-cli 

Run zsh to get back to zshell.




回答3:


When you installed, did you install globally?

npm install -g bower

give that a try. If not, also try adding sudo

sudo npm install -g bower



回答4:


When you install grunt (bower), terminal tell you directory. For those using a ZSH shell, add this to .zshrc:

export PATH=/usr/you/directory/npm/bin:$PATH,

I find it using:

/lib/node_modules
export PATH=/usr/lib/node_modules/npm/bin:$PATH



回答5:


If you are using the GNOME-Terminal (default in Ubuntu Unity and Gnome) try the answer of https://askubuntu.com/questions/279180/nvm-command-not-found-issue.



来源:https://stackoverflow.com/questions/12555129/bower-grunt-zsh-command-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!