npm 安装错误: "Host key verification failed."



我想从 Gitbucket 获取模块,这是我在 Windows 服务器上构建的
但是当我使用npm install时出现错误。

npm ERR! Error while executing:  
npm ERR! C:Users~~~~AppDataLocalProgramsGitcmdgit.EXE ls-remote -h -t  
ssh://git@IPaddress:Gitbucketport/root/modulename.git  
npm ERR!  
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  
npm ERR! A complete log of this run can be found in:  
npm ERR!     C:Users~~~~AppDataRoamingnpm-cache_logs2020-09-09T07_20_32_049Z-debug.log  

当前验证结果。

  • ssh Hostname@port
    → OK
  • git clone git+ssh://git@IPaddress:Gitbucketport/root/modulename.git
    → OK

但是,我对一些事情很好奇。

  1. 我重新安装了OpenSSH。
  2. git 克隆上的指纹现在是 ecdsa。
  3. git 克隆上的指纹与服务器上 ssh_host_ecdsa_key.pub 中的指纹不匹配。

请帮帮我。谢谢。

更新本地known_hosts文件:

ssh-keyscan -t rsa server.com >>~/.ssh/known_hosts

最新更新