Yarn 不安装 git 私有存储库

sun*_*wad 5 git yarnpkg

我正在使用纱线,但它为私有 git 存储库提供以下错误。npm 成功安装了这个 repo。

yarn install v1.2.1
info No lockfile found.
[1/4]   Resolving packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://git@github.com/test/testconfigs.git
Directory: /Users/admin/Projects/Demo/myProject
Output:
Permission denied (publickey).
fatal: Could not read from remote repository.
Run Code Online (Sandbox Code Playgroud)

小智 2

这对我有用:

将 GitHub 密钥添加到授权主机列表中:

ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
Run Code Online (Sandbox Code Playgroud)

原答案:

Git 错误:连接到远程存储库时“主机密钥验证失败”