2016-10-13 54 views
3

我有一個私人回購github與依賴於其他私人github回購和npm install安裝所有依賴沒有問題。紗線:無法克隆私人github回購。 ssh:無法解析主機名github:節點名或服務器名提供,或不知道

我裝紗(在MacOS),並嘗試運行在命令行yarn,但它失敗,出現以下錯誤克隆的私人依賴性:

ssh: Could not resolve hostname github: nodename nor servname provided, or not known 
fatal: Could not read from remote repository. 

如何使紗線安裝模塊?謝謝!

回答

3

現在紗不從private packageprivate github repo

支持安裝有由Milos Ivanovic提供workaround

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.

好在這只是一個之前在GitHub上線支持私人回購的時間問題,因爲它已經有一個pull request

11

[email protected]的工作原理是用

"private-test": "git+ssh://[email protected]/ramasilveyra/private-test.git#d6c5789" 

更換

"private-test": "git+ssh://[email protected]:ramasilveyra/private-test.git#d6c5789" 

類型的網址與/更換:結腸,使其工作。

+0

這是一個更好的時刻,因爲它也解決了這個問題,當一個人使用'bitbucket',謝謝 –

+0

真棒只是想我想找 – PaulSCoder

+0

好。我也得到它在v0.19.1上使用冒號,只要它們是路徑的前導'/',即''private-test「:」git + ssh://[email protected] :/ramasilveyra/private-test.git#d6c5789「' – supremebeing7

相關問題