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
  • 58,414
  • 16
  • 114
  • 157

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
  • 58,414
  • 16
  • 114
  • 157
  • 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
  • 6,143
  • 6
  • 35
  • 55
0

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

ESP32
  • 8,089
  • 2
  • 40
  • 61