在Gitbash - Bower上:ENOGIT git未安装或不在PATH中 [英] On Gitbash - Bower : ENOGIT git is not installed or not in the PATH

查看:131
本文介绍了在Gitbash - Bower上:ENOGIT git未安装或不在PATH中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有bower.json文件的项目,并且正在尝试在Windows上加载它所有的bower库。
我打开Gitbash,cd到该项目目录并输入bower install / bower更新。
我收到一个错误:

  bower ENOGIT git未安装或未安装在PATH 
中 code>

但是有一条路径可以使用git:

  $ which git 
/ bin / git

它实际上在Windows的cmd中工作,但它不适用于Gitbash
这是我在系统PATH env变量中关于git的值:

  C:\程序文件x86)\Develop\VCS\Git\cmd 

我试着重新安装msysgit并选择了以下选项:从Windows命令提示符运行Git,如下所示:




它仍然不起作用..



Bower版本:

  $ bower --version 
1.4.1

Git版本:

  $ git --version 
git版本1.9.5.msysgit.1




  • 全局安装Bower使用npm



编辑:
我找到了这个问题的原因:
我的个人资料中有一个文件home目录.bashrc,我通常用它来定义一般别名等,并且我添加了这一行:

  export PATH =〜/ AppData / Roaming / Composer / vendor / bin:$ PATH 

这行是目前我收到Gitbash错误,虽然很奇怪,它只是添加到全球作曲家包的路径,它与git本身或凉亭有什么关系?

解决方案

检查 saurabhkohli 这个GitHub问题



< blockquote>

[U]将PATH环境变量与当前在系统中安装的GIT位置进行比较将有助于解决此问题,或者您可以在NodeJS命令提示符中使用set PATH =%PATH%; C:\ Program Files \Git\bin;



I have a project with bower.json file and im trying to load all it's bower libraries on Windows. I turn on Gitbash, cd to that project directory and type in bower install / bower update. I receive an error:

bower ENOGIT        git is not installed or not in the PATH

But there is a path to git:

$ which git
/bin/git

So the wierd thing that it actually works in cmd on Windows, but it doesnt work with Gitbash. This is the value i have in the system PATH env variable regarding git:

C:\Program Files (x86)\Develop\VCS\Git\cmd

I tried to re-install msysgit and chose the option: Run Git From Windows Command Prompt like so:

It still doesnt seem to work..

Bower version:

$ bower --version
1.4.1

Git version:

$ git --version
git version 1.9.5.msysgit.1

  • Bower is installed globally using npm

EDIT: I found the cause of this issue: I have a file in my profile home directory .bashrc that i usually use in order to define general aliases and so on and i added this line:

export PATH="~/AppData/Roaming/Composer/vendor/bin":$PATH

And somehow when this line is present i receive the error in Gitbash, wierd though, it just add the path to global composer packages, what it has to do with git itself or bower?

解决方案

Check this solution posted by saurabhkohli in this GitHub issue:

[U]pdating the PATH environment variable with the current installed location of the GIT in your system will help resolve this issue, or you can update the same in your NodeJS command prompt by using "set PATH=%PATH%;C:\Program Files\Git\bin;"

这篇关于在Gitbash - Bower上:ENOGIT git未安装或不在PATH中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆