28

I just installed git and bower via NPM for a project. It's a first time use.

Then I tried running bower install jQuery for example, I get this specific error:

ENOGIT git is not installed or not in the PATH

Where can I actually define paths and how, and when we say PATHs, what's the main idea?

Also, I really need help with some good resources for learning the concept behind this question or learning NPM usage in general.

I'm using windows 7, 64-bit.

Alex Kulinkovich
  • 4,408
  • 15
  • 46
  • 50
user1966211
  • 873
  • 3
  • 11
  • 22
  • Which OS do you use? Can do you launch the `git` command in the terminal? If not, please install it. – Paul Mougel Nov 19 '13 at 10:48
  • Sorry. I just made an edit. – user1966211 Nov 19 '13 at 10:52
  • I had the same problem + angularjs is not defined and other too. Installing msysgit bower install jQuery solved the problem. Now I'm happy :-) – AJ_83 May 19 '15 at 17:21
  • possible duplicate of [Bower : ENOGIT git is not installed or not in the PATH](http://stackoverflow.com/questions/20666989/bower-enogit-git-is-not-installed-or-not-in-the-path) – Moslem Ben Dhaou Jun 20 '15 at 10:47
  • @MoslemBenDhaou Apparently, this question was asked in Nov '13 and the link you posted says the question was asked in Dec '13. I think that link is the duplicate. – BizDev Oct 08 '17 at 06:04
  • @BizDev: The SO review platform does not distinguish based on post date, but I think it uses the voting mechanics instead. The comment is auto posted by the review page – Moslem Ben Dhaou Oct 09 '17 at 17:35

7 Answers7

72

Install msysgit, as stated in the Bower documentation:

To use Bower on Windows, you must install msysgit correctly. Be sure to check the option shown below:

[ ] Use Git bash only

[x] Run Git from the Windows Command Prompt

[ ] Run Git and included Unix tools from the Windows Command Prompt

After the installation has completed, restart CMD. You (and bower) will then be able to run git from the command prompt, which will fix your issue.

Community
  • 1
  • 1
Paul Mougel
  • 16,728
  • 6
  • 57
  • 64
7

Make sure u installed git with 2nd or 3rd option selected from list. It will penetrate git command to cmd by modifying PATH automatically ;)

enter image description here

2

Manual method is to add the Git cmd path to your windows PATH environment variable. The Git cmd path will be unique on your machine, and something like:

C:\Users\<YourUserName>\AppData\Local\GitHub\PortableGit_<SomeGuid>\cmd\

From command prompt, add it to your PATH var like so:

path C:\Users\<YourUserName>\AppData\Local\GitHub\PortableGit_<SomeGuid>\cmd\;%PATH%

James McCormack
  • 9,217
  • 3
  • 47
  • 57
1

Install Bower using Git Bash and run bower install jQuery from Git Bash. Git doesn't work from Windows command prompt as CMD is not POSIX compatible.

Rejoy
  • 327
  • 3
  • 9
  • you are mistaken. it does work from the cmd prompt. npm -g install bower install msysGit while selecting [command prompt] bower install reqwest – Mickey Perlstein Jun 01 '15 at 15:39
1

Forget powershell and command prompt. Use git bash and it works like normal.

Mike Ferrari
  • 157
  • 1
  • 11
1

Make sure you use the "Git bash" in that directory but not the command terminal of the system:like this

enter image description here

athanzhang
  • 122
  • 5
0

First install git on your pc, if you do not add the path then add it yourself

C:\Program Files\Git\cmd