# Npm install private repo with deploy key

**URL:** <https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636>\
**Category:** Build Environment\
**Created:** [September 18, 2017, 11:44pm UTC](https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636 "2017-09-18T23:44:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobinClowers](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/robinclowers/32/17066_2.png) [@RobinClowers](https://discuss.circleci.com/u/RobinClowers)\
**Post date:** [September 18, 2017, 11:44pm UTC](https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636/1 "2017-09-18T23:44:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RobinClowers](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/robinclowers/32/17066_2.png) [@RobinClowers](https://discuss.circleci.com/u/RobinClowers)\
**Post date:** [September 19, 2017, 5:11pm UTC](https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636/2 "2017-09-19T17:11:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wwerner](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/wwerner/32/17787_2.png) [@wwerner](https://discuss.circleci.com/u/wwerner)\
**Post date:** [February 6, 2018, 1:12pm UTC](https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636/3 "2018-02-06T13:12:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RobinClowers](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/robinclowers/32/17066_2.png) [@RobinClowers](https://discuss.circleci.com/u/RobinClowers)\
**Post date:** [February 6, 2018, 5:00pm UTC](https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636/4 "2018-02-06T17:00:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wwerner](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/wwerner/32/17787_2.png) [@wwerner](https://discuss.circleci.com/u/wwerner)\
**Post date:** [February 6, 2018, 5:13pm UTC](https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636/5 "2018-02-06T17:13:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:39am UTC](https://discuss.circleci.com/t/npm-install-private-repo-with-deploy-key/16636/6 "2018-06-18T11:39:56Z")

</div>

Closed on June 18, 2018, 11:39am UTC


