[英]Bower - enogit git is not installed or not in the PATH
I get following error when my Jenkins build runs:当我的 Jenkins 构建运行时,我收到以下错误:
"ENOGIT git is not installed or not in the PATH"
However there is no error when I run it from cmd.但是,当我从 cmd 运行它时没有错误。
The key difference is that one of bower packages uses git://
protocol instead of https://
like other packages do.关键的区别在于 bower 包之一使用git://
协议而不是像其他包那样使用https://
。 I tried to override it in git config to use http://
instead of git://
but no luck, Git is also in a PATH
.我试图在 git config 中覆盖它以使用http://
而不是git://
但没有运气,Git 也在PATH
。
Any ideas how to make it work, one of the solutions would be to make bower download package using https://
not the git://
is that possible?任何想法如何使它工作,解决方案之一是使用https://
而不是git://
制作凉亭下载包,这可能吗?
That error is not related to protocol.该错误与协议无关。 For some reason or another, git executable is not found in the path for your jenkins job.出于某种原因,在您的 jenkins 作业的路径中找不到 git 可执行文件。 This is different from your user path and system path, so even if it is in those, it seems it is not in jenkins job path.这与您的用户路径和系统路径不同,因此即使在这些路径中,似乎也不在 jenkins 工作路径中。
You can confirm this by running a shell script as a build step and trying to use git there.您可以通过运行 shell 脚本作为构建步骤并尝试在那里使用 git 来确认这一点。
You can also try echoing/setting the path before you call bower to troubleshoot/work around the problem.您还可以在调用 bower 来解决/解决问题之前尝试回显/设置路径。
经过一些回声后,我发现运行 Jenkins 的用户在路径中没有 GIT(系统用户),因为我找不到在该用户下登录并编辑 PATH 变量的方法,我重新启动了服务器,它开始像我一样工作预期的。
You should check PATH in environment variables.您应该在环境变量中检查 PATH。 And if path has not location of git... then paste this into PATH :如果路径没有 git 的位置...然后将其粘贴到 PATH 中:
C:\Program Files\Git\bin;C:\Program Files\Git\cmd
And restart gitbash,cmd or jenkin build cmd.并重新启动 gitbash,cmd 或 jenkin build cmd。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.