已安装Git并在路径中。

平台:Red Hat Enterprise Linux 5.8。

>which git
/usr/local/bin/git

然而鲍尔却找不到它:

bower angular#1.0.6  ENOGIT git is not installed or not in the PATH

建议的解决方案是什么?


当前回答

只需使用Git Bash而不是cmd。

其他回答

我有同样的问题,需要重新启动cmd -问题消失了。

只需使用Git Bash,而不是node.js或命令提示符

以安装ReactJS为例,打开Git Bash后,执行以下命令安装react:

bower install --react

我在Windows上也有同样的错误。添加git到路径解决了这个问题。

G:\Dropbox\Development\xampp\htdocs.penfolds.git\penfolds-atg-development>bower install
bower bootstrap#~3.0.0          ENOGIT git is not installed or not in the PATH

G:\>PATH
PATH=E:\Program Files\Windows Resource Kits\Tools\;

G:\Dropbox\Development\xampp\htdocs.penfolds.git\penfolds-atg-development>set PATH=%PATH%;E:\Program Files\Git\bin;

G:\Dropbox\Development\xampp\htdocs.penfolds.git\penfolds-atg-development>bower install
bower bootstrap#~3.0.0      not-cached git://github.com/twbs/bootstrap.git#~3.0.0
bower bootstrap#~3.0.0         resolve git://github.com/twbs/bootstrap.git#~3.0.0

1.在环境变量中设置Git的路径。 2.在Windows命令提示符中, 运行cd项目\文件夹\路径\ 执行命令:bower install

在Linux中:

如果你没有安装git,请使用:

sudo apt-get update
sudo apt-get install git

使用命令,你将知道目录在哪里,然后添加路径,如果它不在那个环境变量。