Npm install private repo with deploy key

I’m trying to build a project which depends on another private repo on github (via npm using github:/<organization>/<project> as the )

When I npm install, it fails with ERROR: Repository not found. fatal: Could not read from remote repository. So I added a github deploy key to that repo, and added that key to my Circle project.

I’m using Circle 2.0, so that key is automatically added to the ssh-agent running on my container, but for some reason, the npm install is still failing. Any idea where I went wrong?

Also, it’s worth noting that the docs say to use a user key for this, but I don’t think that’s a good solution, since it requires me to manage those credentials.

2 Likes

Github says that key has never been used, so I can only assume that for some reason the git client isn’t trying all the keys registered with ssh-agent. I would like to explicitly configure ssh to use that key for github, but I can’t since the key doesn’t appear to be written to the filesystem.

Did you ever manage to figure out how to fix this? Same thing happens for me.

No, in the end I used a user key to work around this issue.

1 Like

Thanks Robin. Pity, this does not really feel right. Should be working with ssh keys, IMHO. Using a technical user is just an ugly workaround.

1 Like