简体   繁体   English

npm 安装错误:“主机密钥验证失败。”

[英]npm install error : “Host key verification failed.”

I want to get the module from Gitbucket, which I built on a windows server.我想从 Gitbucket 获取模块,我在 Windows 服务器上构建了它。
But I get an error when I use npm install .但是当我使用npm install时出现错误。

npm ERR! Error while executing:  
npm ERR! C:\Users\~~~~\AppData\Local\Programs\Git\cmd\git.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\~~~~\AppData\Roaming\npm-cache\_logs\2020-09-09T07_20_32_049Z-debug.log  

Current verification results.当前验证结果。

  • ssh Hostname@port ssh 主机名@端口
    → OK → 确定
  • git clone git+ssh://git@IPaddress:Gitbucketport/root/modulename.git git clone git+ssh://git@IPaddress:Gitbucketport/root/modulename.git
    → OK → 确定

But, I'm curious about something.但是,我对某事很好奇。

  1. That I reinstalled OpenSSH.我重新安装了OpenSSH。
  2. The fingerprint on the git clone is now ecdsa. git clone 上的指纹现在是 ecdsa。
  3. The fingerprint on the git clone doesn't match the fingerprint in ssh_host_ecdsa_key.pub on the server. git clone 上的指纹与服务器上 ssh_host_ecdsa_key.pub 中的指纹不匹配。

Please help me.请帮我。 thank you.谢谢你。

更新您的本地 known_hosts 文件:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM