npm安装错误:“主机密钥验证失败." [英] npm install error : "Host key verification failed."

查看:599
本文介绍了npm安装错误:“主机密钥验证失败."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to get the module from Gitbucket, which I built on a windows server.
But I get an error when I use 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  

当前验证结果.

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

但是,我对某些事情很好奇.

But, I'm curious about something.

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

请帮助我.谢谢.

推荐答案

更新您的本地known_hosts文件:

Update your local known_hosts file:

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

这篇关于npm安装错误:“主机密钥验证失败."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆