Twitter 鲍尔、格伦特及;zsh:未找到命令:

Twitter 鲍尔、格伦特及;zsh:未找到命令:,twitter,zsh,npm,gruntjs,Twitter,Zsh,Npm,Gruntjs,我已经安装了Grunt&Bower&我正在使用ZSH 当我键入bower--help或grunt anything时,我得到zsh:command not found:bower或zsh:command not found:grunt如何解决此问题?安装时,是否进行了全局安装 npm install -g bower 试试看。如果没有,也可以尝试添加sudo sudo npm install -g bower 将/usr/local/share/npm/bin/添加到您的$PATH环境中我无

我已经安装了Grunt&Bower&我正在使用ZSH


当我键入
bower--help
grunt anything
时,我得到
zsh:command not found:bower
zsh:command not found:grunt
如何解决此问题?

安装时,是否进行了全局安装

npm install -g bower
试试看。如果没有,也可以尝试添加sudo

sudo npm install -g bower

/usr/local/share/npm/bin/
添加到您的
$PATH环境中

我无法使上述操作正常工作。问题是我刚刚重新安装了Mac电脑,却忘了重新安装grunt

通过使用
bash-l
返回bash并运行
grunt
,可以测试grunt是否在zshell之外实际安装并正常工作

如果grunt抛出相同错误,则可以通过运行以下命令安装grunt:

sudo npm install -g grunt-cli 

运行
zsh
返回zshell。

如果您正在使用GNOME终端(Ubuntu Unity和GNOME中的默认设置),请尝试以下答案

安装grunt(bower)时,终端会告诉您目录。对于使用ZSH shell的用户,请将以下内容添加到.zshrc:

export PATH=/usr/you/directory/npm/bin:$PATH,
我发现它使用了:

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

我使用了
纱线
而不是
npm

yarn add grunt grunt-cli
yarn grunt
这对我有用。
希望它能帮助其他人:)

我在他们的网站上使用命令安装了它
npm install bower-g
我在
vows
here=/对于那些使用ZSH shell的人,将这个添加到.zshrc:“export PATH=/usr/local/share/npm/bin:$PATH”@Sam&neon。。。我在尝试为zsh使用bower插件时遇到了同样的问题,现在问题解决了。谢谢,伙计们;)你是怎么安装的<代码>npm安装-g grunt<代码>npm安装-g grunt cli?万岁!轻松点!