-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Permission denied (publickey) when installing from private Git repository on Windows #2891
Comments
I've also run into this problem. You need to start the SSH Agent using the |
Experiencing the same issue with npm 7.10.0 on Windows with a GitLab private repository accessed via I tried to enforce a key in @thexeos did you figure out how to workaround this issue? |
@simonbrunel on the same system from the initial report - it it still broken. On another system, while configuring SSH access, I somehow made npm work. The steps I followed to get SSH access working are: PowerShell/Win32-OpenSSH#307 (comment) my Maybe this will also be relevant: https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate |
Hi, same problem here on npm 8 on windows 10. On @npmcli/git/lib/opts.js there is the initialization of the
This overrides the I just commented the line to make it works.. |
Thanks for that ! |
I have the same issue with npm 8.3.1. I'm using the
As mentioned above, explicitly setting, For more context, the command that was failing was:
(I assume npm uses this to get the appropriate tag) |
When settings GIT_SSH_COMMAND, the quotes around the path are important. Otherwise it won't work. |
The setting of the |
Ah, I see. On a side note, a hanging installation as described in npm/git#7 is certainly not good but I am not sure that simply accepting all new host keys is the wise thing to do. Perhaps aborting with an error would be better. But I'll assume you have evaluated this question and came to the conclusion that the risk is acceptable. The solution in npm/git@8f2ce04 is not going to work and should definitely be reverted in its current state. There are three (four if you include the Unfortunately for |
This bug also exists on MacOS |
Could you please share more details on this? |
Offered a PR to resolve this in npm/git#194 |
npm will no longer manually set `GIT_ASKPASS` or `GIT_SSH_COMMAND` if it finds those values already defined in the user's git config. ## References npm/cli#2891 #193 #129 --------- Co-authored-by: pacotedev <i+pacotedev@izs.me>
This issue is now resolved in @wraithgar I think this can be closed now |
Current Behavior:
Running
npm i git+ssh://git@domain.com:namespace/repo.git
through PowerShell on Windows results in the following error:Running the failed
git ls-remote git@git.domain.com:namespace/repo.git
command in the same PowerShell window immediately, after correctly prompts for the password:Expected Behavior:
When SSH key used for accessing Git repo requires a password, npm should prompt for it within PowerShell.
Steps To Reproduce:
This can also be reproduced by adding an entry to
package.json
and then runningnpm i
Environment:
The text was updated successfully, but these errors were encountered: