npm - yarn : unable to clone private github repo. ssh : Could not resolve hostname github: nodename nor servname provided, 或未知

标签 npm yarnpkg

我在 github 上有一个私有(private)仓库,它依赖于其他私有(private) github 仓库和 npm install安装所有依赖项没有问题。

我安装了 Yarn(在 MacOS 上)并尝试运行 yarn在命令行中,但它无法克隆私有(private)依赖项,并出现以下错误:

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

如何让 yarn 安装模块?谢谢!

最佳答案

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"

替换 :带有 / 的冒号让它工作。

关于npm - yarn : unable to clone private github repo. ssh : Could not resolve hostname github: nodename nor servname provided, 或未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40016023/

相关文章:

node.js - 如何找到对 npm 包的反向依赖?

node.js - 使用本地 NPM 包

node.js - 如何使用 npm 脚本获取 shell 脚本?

javascript - 在 docker 容器中安装 yarn 说缺少依赖

npm - yarn 安装 |警告模式正在尝试在同一目的地解包

javascript - 重定向时将数据传递到我的 ejs View

javascript - npm 关于回调错误的指南

Jenkins 构建错误 : Build step 'Invoke top-level Maven targets' marked build as failure

javascript - 无法使 JS 插件与 Rails 5.1 和 Yarn 一起工作

node.js - 从 Angular 6 迁移到 Angular 7 导致错误 - 无法解析 'core-js/es7/reflect'