5

I'm building a project that has a Git repository as a dependency:

"dependencies": {
    "base-resources": "git@git.companyname.com:bower-projects/base-resources.git"
}

The build fails like so:

bower ECMDERR Failed to execute "git ls-remote --tags --heads git@git.companyname.com:bower-projects/base-resources.git", exit code of #128 Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Additional error details: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

However, I can run the same command from Git bash with no issues:

git ls-remote --tags --heads git@git.companyname.com:bower-projects/base-resources.git

I've tried all the common solutions, such as changing the Git URL protocol, clearing the Bower cache, and setting specific local SSH config options for this host:

Host git.companyname.com
RSAAuthentication yes
IdentitiesOnly yes
IdentityFile ~/.ssh/gitlab_rsa
User git

What other issues should I check for?

Community
  • 1
  • 1
isherwood
  • 46,000
  • 15
  • 100
  • 132
  • Hey, I'm facing the same issue. Were you able to resolve it? – Lizzy Jan 08 '16 at 09:17
  • 1
    I ended up running my Bower commands from Git bash rather than the Windows terminal. That works, though I'm not 100% sure something else didn't resolve the issue as well. – isherwood Jan 08 '16 at 14:07
  • Thanks! This worked for me as well. Maybe you could provide your own answer to this question :) – Lizzy Jan 11 '16 at 05:34

3 Answers3

4

My solution ended up being to use Git bash rather than the Windows terminal (or ConEmu in my case). Something is handled differently with respect to SSH keys between the two systems.

isherwood
  • 46,000
  • 15
  • 100
  • 132
  • Yea this is old, im still responding to it though: Probably the `git bash` uses the `.ssh` folder as default while you need an **SSH agent** like **PageAnt** to get the same behavior for the default `windows console`. – Xatenev Jun 13 '16 at 09:35
  • 1
    This helped me, I was also using ConEmu. – 11thdimension Mar 03 '17 at 05:22
0
  1. Run bower install in git bash
  2. Clean the bower directtory under C:\Users\AppData\Local\bower
  3. Run git config --global url.https://.insteadOf git://
  4. Then bower cache clean.
  5. Finally bower install again.
chrki
  • 5,626
  • 6
  • 28
  • 51
0

I could run the bower package installation by launching the command line window "as Administrator".

Gerfried
  • 6,193
  • 28
  • 47