1

Windows 8 Composer Install from private repository Message: "Failed to clone ... git was not found, git was not found, check that it is installed and in your path ENV".

I have tried using composer install from both the Windows terminal and Git Bash with the same message. Git is definitely installed with the correct path environments, and the same with Composer.

My private repositories have worked elsewhere on Windows 7 and on a Linux server so I believe this could be a Windows 8 problem.

Has anyone else had this same problem? If so, how would you go about fixing it?

It is just a general Windows problem and I can use git and even find the Git version, but when trying to composer install or update, it can't find git.

I would appreciate any answers.

CheckeredMichael
  • 571
  • 8
  • 30
  • So git is in your Path? As in http://stackoverflow.com/a/20169377/6309? You can type `git --version` in any shell and it is working? – VonC Apr 12 '14 at 09:26
  • Yup, In my Windows shell and in Git Bash, if I git --version it will tell me. In my PATH variables I have two git paths, one pointing to bin and the other to cmd. – CheckeredMichael Apr 12 '14 at 09:51
  • Is it possible your composer doesn't inherit the environment variable of your current session? (because it could be executed under a different account, or using the system account?) – VonC Apr 12 '14 at 09:52
  • How would you mean? I only use Git and Composer on a single login for my Windows PC. Is there a way I can check this? – CheckeredMichael Apr 12 '14 at 09:54
  • Ask composer or php itself (with `phpinfo`) to display the environment variables known during execution. I don't know composer, but maybe `php composer.phar diagnose` – VonC Apr 12 '14 at 09:58
  • I will give this a go and come back to you with more details. – CheckeredMichael Apr 12 '14 at 10:16
  • Found out the problem was due to a command plugin which didn't install properly and some how caused composer to not find my git environment variables. – CheckeredMichael Jun 02 '14 at 10:42
  • Great! Was `php composer.phar diagnos` useful in that context? – VonC Jun 02 '14 at 10:56
  • I can't remember if I tried that, but I basically left it for a while. I then went to change something in my registry and found this rogue bit of registry from a plugin which didn't install properly. It came to me that it could be that which stopped Composer so I deleted it then tested Composer and it started working. :D – CheckeredMichael Jun 02 '14 at 15:04
  • Good catch. You could add an answer with as many details as possible (like the specific plugin/registry you had to fix), for other to benefit from your experience. – VonC Jun 02 '14 at 15:06

2 Answers2

1

For anyone wanting to know how I fixed this issue. I had tried installing a plugin for command prompt which adds colour to the command for better feedback (I think this was something for a Ruby program).

The plugin went Rogue and wasn't installing properly, this some how interfered with Composer trying to find git and caused me a big headache.

I found the problem when searching for something in the registry and it required me to go into HKEY_CURRENT_USER and found it somewhere in there. I remembered it being something I installed and completely forgot about so it just clicked.

I deleted this from the registry and voila composer started running as it should have from the start. I ran the composer install with some packages which are private to me and they downloaded without a problem.

CheckeredMichael
  • 571
  • 8
  • 30
0

There are multiple ways to get to the "Advanced Properties" so I am picking one:

From Control Panel choose System

From System choose Advanced System Settings

From Advanced System Settings choose Environment Variables...

In the System Variables list scroll down to Path

In the dialog box that pops up located the BIN and CMD variables for GIT and delete them

In that same dialog box scroll to the end of that path and add the following ;C:\Program Files\Git\bin;C:\Program Files\Git\cmd making sure no spaces are present expect in the folder name Program Files

  • this assumes C:\program files is the install group folder

Also see here for additional help: 'git' is not recognized as an internal or external command

Community
  • 1
  • 1
Invictuz
  • 61
  • 1
  • 4
  • Found out the problem was due to a command plugin which didn't install properly and some how caused composer to not find my git environment variables. – CheckeredMichael Jun 02 '14 at 10:40