1

I have the below private git repo mentioned in the package.json variable:

git+ssh://git@github.com:knowyrtech/actions_param.git

I setup ssh keys on my Windows and I m able to authenticate and clone the repositories as below without any prompt / user-input:

Works -> git clone git@github.com:knowyrtech/actions_param.git

However, the below does not work and prompts for credentials which is the problem i wish to seek a solution for:

git+ssh://git@github.com:knowyrtech/actions_param.git

npm ci

It runs and then prompts asks me for authentication.

Can you please suggest?

Ashar
  • 2,942
  • 10
  • 58
  • 122

1 Answers1

0

First, make sure your private key is not encrypted, or you will have to deal with "adding your SSH key to the ssh-agent".
For testing, a regular private key is easier.

Second, in your CMD session (where you try your npm command), for the key with

set "GIT_SSH_COMMAND=ssh -i %USERPROFILE%\.ssh\mykey"

Even if your key is the default one (id_rsa for instance), that is one more signal for Git (through npm) to use it.

Then retry the npm ci command, maybe with a verbose mode, to ensure it actually is your private repository which is the issue (and not some other dependency).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250