node.js - yarn 包管理器 : install dependencies from private Bitbucket repository

标签 node.js git bitbucket yarnpkg

我正在尝试将项目从 NPM 迁移到 Yarn

我的部分 Node 依赖项是在我工作的公司的 namespace 下托管在 Bitbucket 上的私有(private)包(未发布在 NPM 注册表上)。

有了 NPM,我可以在我的 package.json 中用不同的语法声明这些类型的依赖关系。像这样:

// package.json

"dependencies": {
  ...
  @myCompany/package-name": "bitbucket:bitbucket-username/repo-name.git",
  ...
}

但是当我运行 yarn install 时出现以下错误:

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

我在 MAC OSX 上运行 yarn v0.23.3

是否有任何进一步的语法或解决方法让 yarn 从 bitbucket 安装私有(private)存储库?

我已经进入了 Yarn's github issues ,但我找不到任何提示 决定是继续尝试还是放弃。

提前致谢!

最佳答案

尝试

"@myCompany/package-name": "git+ssh://git@bitbucket.org/bitbucket-username/repo-name.git",

至少,这就是我正在使用的并且它可以正常工作。

关于node.js - yarn 包管理器 : install dependencies from private Bitbucket repository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43708262/

相关文章:

javascript - 纪元太精确

javascript - 在nodejs中将现有对象查找到数组中

git - 当与多个用户一起工作时,GitHub Developer 计划如何运作?

git - 将 Mercurial 文件夹转换为 Git 存储库

git - BitBucket - 下载 ZIP 格式的源代码

git - 是否可以使用 git archive 仅下载在提交/修订中更改的文件

git - Bitbucket 无法克隆存储库 "fatal: early EOF fatal: index-pack failed"

node.js - Heroku 上的 Node 应用程序由于只读文件系统而失败

javascript - Nodejs Sequelize 的 FindOne() 模型包含四舍五入或 chop 的值

git - 使用 GPG 签署 git 提交的问题