On Gitbash - Bower : ENOGIT git is not installed or not in the PATH

18,033

Solution 1

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;"

Solution 2

I just hit the same issue when trying to use windows command line. Turns out, you have to select this setting twice and I have missed the second one.

Here's a few screenshots if any help for anyone:

i

The one I have missed: j

After reinstalling with the above settings, everything seem to be ok.

Share:
18,033
Lihai
Author by

Lihai

Updated on June 04, 2022

Comments

  • Lihai
    Lihai almost 2 years

    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:

    enter image description here

    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?