I have a private repo on github with dependencies on other private github repos and npm install
installs all the dependencies without problems.
I installed Yarn (on MacOS) and tried to run yarn
in the command line, but it failed cloning the private dependencies with the following error:
ssh: Could not resolve hostname github: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
How do I make yarn install the modules? Thanks!
[email protected] works by replacing the url of type
"private-test": "git+ssh://[email protected]:ramasilveyra/private-test.git#d6c5789"
with
"private-test": "git+ssh://[email protected]/ramasilveyra/private-test.git#d6c5789"
Replace :
colon with /
to make it work.
For now Yarn doesn't support installation from private package and private github repo
There is a workaround provided by Milos Ivanovic:
If you add the following to your ~/.ssh/config file:
Host github.com User git
you can force all logins to github.com via SSH to use the user git by >default, and this makes yarn able to clone from private repositories when using the ssh://github.com// source format.
Fortunately this is just a matter of time before yarn support private repo on github, as there is already a pull request for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With