Node.js npm安装错误:";主机密钥验证失败。”;

Node.js npm安装错误:";主机密钥验证失败。”;,node.js,git,npm,ssh,gitbucket,Node.js,Git,Npm,Ssh,Gitbucket,我想从Gitbucket获取模块,它是我在windows服务器上构建的。 但是我在使用npm安装时出错 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

我想从Gitbucket获取模块,它是我在windows服务器上构建的。
但是我在使用
npm安装时出错

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  
当前验证结果。

  • sshHostname@port
    → 嗯
  • git克隆git+ssh://git@IP地址:Gitbucketport/root/modulename.git
    → 嗯
但是,我有点好奇

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

  • 请帮帮我。谢谢。

    更新您的本地已知主机文件:

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