Yarn:无法克隆私有github repo.无法解析主机名github: nodename或servname提供,或不



我在github上有一个私人回购,依赖于其他私人github回购和npm install安装所有依赖关系没有问题。

我安装了Yarn(在MacOS上),并试图在命令行中运行yarn,但克隆私有依赖失败,出现以下错误:

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

我如何使纱线安装模块?谢谢!

Yarn@0.16.0通过替换类型为

的url工作
"private-test": "git+ssh://git@github.com:ramasilveyra/private-test.git#d6c5789"

"private-test": "git+ssh://git@github.com/ramasilveyra/private-test.git#d6c5789"

:冒号替换为/使其正常工作

目前Yarn不支持从私有包和私有github repo安装

Milos Ivanovic提供了一个解决方案:

如果在~/。ssh/config文件:

Host github.com
    User git 

你可以强制所有通过SSH登录到github.com的用户默认使用git,这使得yarn能够克隆使用ssh时的私有存储库://github.com//源格式。

幸运的是,在yarn支持github上的私有repo之前,这只是一个时间问题,因为已经有了它的pull请求。

最新更新