[英]Bower: ENOGIT Git is not installed or not in the PATH
Git is installed and is in the path. Git 已安装并在路径中。
Platform: Red Hat Enterprise Linux 5.8.平台:红帽企业 Linux 5.8。
>which git
/usr/local/bin/git
Yet bower can't find it:然而凉亭找不到它:
bower angular#1.0.6 ENOGIT git is not installed or not in the PATH
What is the recommended work-around?推荐的解决方法是什么?
Adding Git to Windows 7/8/8.1 Path将 Git 添加到 Windows 7/8/8.1 路径
Note: You must have msysgit installed on your machine.注意:您的机器上必须安装msysgit 。 Also, the path to my Git installation is "C:\Program Files (x86)\Git".另外,我的 Git 安装路径是“C:\Program Files (x86)\Git”。 Yours might be different.你的可能不一样。 Please check where yours is before continuing.请在继续之前检查您的位置。
Open the Windows Environment Variables/Path Window.打开 Windows 环境变量/路径窗口。
Add the pwd to Git's binary and cmd at the end of the string like this:将 pwd 添加到 Git 的二进制文件中,并在字符串末尾添加 cmd,如下所示:
;%PROGRAMFILES(x86)%\Git\bin;%PROGRAMFILES(x86)%\Git\cmd
Now test it out in PowerShell.现在在 PowerShell 中进行测试。 Type git
and see if it recognizes the command.键入git
并查看它是否识别该命令。
Source: Adding Git to Windows 7 Path来源: 将 Git 添加到 Windows 7 路径
只需使用 Git Bash 而不是 cmd。
Run the following command at your node.js command prompt where "<git path>" is the path to your git bin folder:在 node.js 命令提示符处运行以下命令,其中“<git path>”是 git bin 文件夹的路径:
set PATH=%PATH%;<git path>;
So, like this:所以,像这样:
set PATH=%PATH%;C:\Program Files\Git\bin;
Or this: (Notice the (x86) )或者这个:(注意 (x86) )
set PATH=%PATH%;C:\Program Files (x86)\Git\bin;
This will add git to your path variables.这会将 git 添加到您的路径变量中。 Be sure you type it correctly or you could possibly delete your path vars which would be bad.确保你输入正确,否则你可能会删除你的路径变量,这会很糟糕。
Make sure you installed Git with the second or third option selected from the list.确保安装 Git 时选择了列表中的第二个或第三个选项。 It will penetrate the Git command to cmd by modifying PATH automatically ;)它将通过自动修改 PATH 将 Git 命令渗透到 cmd ;)
I had the same error in Windows.我在 Windows 中遇到了同样的错误。 Adding git to the path fixed the issue.将 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
I am also getting the same error and the solution is first to check if the Git is installed or not in the system and if not please install it.我也遇到同样的错误,解决方法是首先检查系统中是否安装了Git ,如果没有,请安装它。
After installation, open Git Bash or Git Shell from Windows and go to your project (same way you go in command prompt using "cd path").安装后,从 Windows 打开Git Bash或Git Shell并转到您的项目(与使用“cd path”进入命令提示符的方式相同)。 Git Shell is installed by default with Github windows installation. Git Shell默认随Github windows 安装一起安装。
Then run the same bower install command.然后运行相同的bower install命令。 It will work as expected.它将按预期工作。
The below screenshot shows the command using Git Shell下面的屏幕截图显示了使用Git Shell的命令
在 Windows 上,您可以尝试在命令提示符处设置路径:
set PATH=%PATH%;C:\Program Files\Git\bin;
When you ran the git install, you probably didn't choose:当你运行 git install 时,你可能没有选择:
"Use Git from the Windows Command Prompts" “从 Windows 命令提示符中使用 Git”
during the installation.在安装过程中。
Re-run git install, and choose that option.重新运行 git install,然后选择该选项。
You are missing the ENVIRONMENT PATH.您缺少环境路径。 Follow these steps:按着这些次序:
;%PROGRAMFILES%\Git\bin;%PROGRAMFILES%\Git\cmd ;%PROGRAMFILES%\Git\bin;%PROGRAMFILES%\Git\cmd
I also got the same problem from cmd and resolved using the following steps.我也从 cmd 得到了同样的问题,并使用以下步骤解决了。
First install the https://msysgit.github.io/ (if not alredy installed).首先安装https://msysgit.github.io/ (如果尚未安装)。 Then set the Git path as suggested by skinneejoe:然后按照 skinneejoe 的建议设置 Git 路径:
set PATH=%PATH%;C:\Program Files\Git\bin;
Or this (notice the (x86)):或者这个(注意(x86)):
set PATH=%PATH%;C:\Program Files (x86)\Git\bin;
In Linux:在 Linux 中:
if you dont have installed git use:如果你没有安装 git 使用:
sudo apt-get update
sudo apt-get install git
with command which git
you will know the directory where is and then add in path if it is not in that enviroment variable.使用which git
命令,您将知道目录在哪里,如果它不在该环境变量中,则添加路径。
I bumped into this problem on a cPanel CentOS 6 linux machine.我在 cPanel CentOS 6 linux 机器上遇到了这个问题。 The solution for me was to symlink the cPanel git to /usr/local/bin/git我的解决方案是将 cPanel git 符号链接到/usr/local/bin/git
ln -s /usr/local/cpanel/3rdparty/bin/git /usr/local/bin/git
1.Set the Path of Git in environment variables. 1.在环境变量中设置Git的路径。 2.From Windows command prompt, run cd Project\folder\Path\ run the command: bower install 2.在 Windows 命令提示符下,运行 cd Project\folder\Path\ 运行命令: bower install
People above already gave solutions for your proplem, I hope so.上面的人已经为您的问题提供了解决方案,我希望如此。 If someone is facing this issue in 2022 in using docker images, then you should add a command to install git in your image.如果有人在 2022 年在使用 docker 映像时遇到此问题,那么您应该添加一个命令以在您的映像中安装 git。
For Example you are using alpine image in your Dockerfile
.例如,您在Dockerfile
中使用高山图像。 Then it will be something like this:然后它会是这样的:
FROM node:8.3-alpine
# ....... other stuffs .....
RUN apk add git
# ....... other stuffs .....
I solved the problem by install Git Bash from Download Git Bash .我通过从Download Git Bash安装 Git Bash 解决了这个问题。
Setting this option 3 when installing the software as shown bellow.安装软件时设置此选项 3,如下图所示。
Finally select the project folder by right click using Bash as shown below.最后使用 Bash 右键单击选择项目文件夹,如下所示。
and type并输入
npm install npm 安装
. . It works for me.这个对我有用。
npm install
from git bash did work for me.来自git bash的npm install
对我有用。 After rebooting PC.重启电脑后。
Just use the Git Bash instead of node.js or command prompt只需使用 Git Bash 而不是 node.js 或命令提示符
As an Example for installing ReactJS, after opening Git Bash, execute the following command to install react:以安装 ReactJS 为例,打开 Git Bash 后,执行以下命令安装 react:
bower install --react
我遇到了同样的问题,需要重新启动 cmd - 问题就消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.