node.jsgitnpmsshgitbucket

npm install error : "Host key verification failed."


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  

Current verification results.

But, I'm curious about something.

  1. That I reinstalled OpenSSH.
  2. The fingerprint on the git clone is now ecdsa.
  3. The fingerprint on the git clone doesn't match the fingerprint in ssh_host_ecdsa_key.pub on the server.

Please help me. thank you.


Solution

  • Update your local known_hosts file:

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