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

Mio*_*_NC 2 git ssh node.js npm gitbucket

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

\n
npm ERR! Error while executing:  \nnpm ERR! C:\\Users\\~~~~\\AppData\\Local\\Programs\\Git\\cmd\\git.EXE ls-remote -h -t  \nssh://git@IPaddress:Gitbucketport/root/modulename.git  \nnpm ERR!  \nnpm ERR! Host key verification failed.  \nnpm ERR! fatal: Could not read from remote repository.  \nnpm ERR!  \nnpm ERR! Please make sure you have the correct access rights  \nnpm ERR! and the repository exists.  \nnpm ERR!  \nnpm ERR! exited with error code: 128  \nnpm ERR! A complete log of this run can be found in:  \nnpm ERR!     C:\\Users\\~~~~\\AppData\\Roaming\\npm-cache\\_logs\\2020-09-09T07_20_32_049Z-debug.log  \n
Run Code Online (Sandbox Code Playgroud)\n

当前验证结果。

\n
    \n
  • ssh 主机名@端口
    \n\xe2\x86\x92 确定
  • \n
  • git clone git+ssh://git@IP地址:Gitbucketport/root/modulename.git
    \n\xe2\x86\x92 确定
  • \n
\n

但是,我对某件事很好奇。

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

请帮我。谢谢。

\n

小智 6

更新本地的known_hosts文件:

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