Npm install github private repo failed

Viewed 83

ssh -T git@github.com success

git clone git clone git@github.com:<username>/<repo>.git success

So I think I have set the right ssh key for github , but when I run

npm install git+ssh://github.com:<username>/<repo>.git Failed

errors are some thing like

Connection reset by 20.205.243.166 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

Can anyone help me to solve the problem , Thank you.

1 Answers

Chekc what is going on with:

GIT_SSH_COMMAND='ssh -v' npm install git+ssh://git@github.com:my-org/private-repo.git

You will see what key is consider by the npm install ssh command.

In case your private key is not standard:

GIT_SSH_COMMAND='ssh -i ~/.ssh/<your private key>' npm install git+ssh://git@github.com:my-org/private-repo.git
Related