v0.16.0で普通にできるようになりました。
package.jsonに依存性のGit参照としてgit+ssh
から始まるURLを書いた状態で、yarn install
を行うと失敗します。
今後対応されるらしいですが、現状の対処方法がGitHubのissueにあったのでメモとして残しておきます。
ただし、この変更を行うと環境によってはnpm install
が失敗するようになるので、チーム全員Yarnに乗り換える必要があるかもしれません。
失敗するpackage.jsonの例
{
"name": "hoge",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"private-package": "git+ssh://git@host/user/private-repo.git"
}
}
対処方法
1. 依存するリポジトリのURLを変更する
- git+ssh://git@host/user/private-repo.git
+ ssh://host/user/private-repo.git
2. ~/.ssh/configに設定を追加する
Host bitbucket.org
User git
Host github.com
User git