【发布时间】:2020-08-27 13:55:52
【问题描述】:
我正在尝试从私有 Bitbucket 存储库安装 NPM 模块。
我可以在我的系统上本地成功运行npm install,但在服务器上却失败了。
错误是:
npm ERR! Error while executing:
npm ERR! /bin/git ls-remote -h -t ssh://git@bitbucket.org/myorg/my-repo.git
npm ERR!
npm ERR!
npm ERR! (ssh-askpass:10260): Gtk-WARNING **: cannot open display: :0.0
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
奇怪的是,手动克隆服务器上的 repo 可以正常工作:
git clone git@bitbucket.org:myorg/my-repo
所以 SSH 密钥配置正确。
【问题讨论】: