How to clone private dependencies

by bradrydzewski

Cloning private dependencies using npm install, go get, etc may encounter the below error. This happens when a dependency url uses git+ssh and requires a private rsa key for authorization.

Warning: Permanently added ',' (RSA)
to the list of known hosts.

ERROR: Repository not found.
fatal: Could not read from remote repository.

Example dependency defined using git+ssh in a package.json file:

  "library": "git+ssh://"

Instead consider defining dependencies using git+https:

- "library": "git+ssh://"
+ "library": ""

The above example overrides the dependency url to force git+https. This configuration instructs git to use authorization credentials stored in an automatically created .netrc file.