已安装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并在路径中。
平台: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
建议的解决方案是什么?
当前回答
在node.js命令提示符下执行以下命令,其中“<git path>”是git bin文件夹的路径:
set PATH=%PATH%;<git path>;
就像这样:
set PATH=%PATH%;C:\Program Files\Git\bin;
或者这个:(注意(x86))
set PATH=%PATH%;C:\Program Files (x86)\Git\bin;
这将把git添加到路径变量中。确保你输入正确,否则你可能会删除你的路径变量,这将是糟糕的。
其他回答
我有同样的问题,需要重新启动cmd -问题消失了。
上面的人已经为你的问题给出了解决方案,我希望如此。如果有人在2022年使用docker镜像时面临这个问题,那么你应该添加一个命令来在你的镜像中安装git。
例如,您在Dockerfile中使用alpine image。那么它将是这样的:
FROM node:8.3-alpine
# ....... other stuffs .....
RUN apk add git
# ....... other stuffs .....
我在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
您错过了环境路径。遵循以下步骤:
搜索“编辑系统环境变量”。 点击“环境变量”。 在“系统变量”部分,向下滚动并单击变量“Path”。点击“编辑”。 将此文本附加到“变量值”的末尾。
;%PROGRAMFILES%\Git\bin;%PROGRAMFILES%\Git\cmd
1.在环境变量中设置Git的路径。 2.在Windows命令提示符中, 运行cd项目\文件夹\路径\ 执行命令:bower install