npm install 报错Host key verification failed. npm ERR! fatal: Could not read from remote repository.
时间: 2023-05-27 12:06:50 浏览: 310
这个错误通常是由于ssh连接失败引起的。可以尝试以下步骤解决该问题:
1. 确认你的网络连接正常,能够访问互联网。
2. 确认你的ssh配置正确,可以尝试使用ssh命令连接远程仓库。
3. 删掉~/.ssh/known_hosts文件,重新执行npm install。
4. 尝试使用https连接仓库,可以通过以下命令配置:
```
npm config set registry https://registry.npmjs.org/
```
或者在package.json文件中配置:
```
"registry": "https://registry.npmjs.org/"
```
相关问题
Error while executing: npm ERR! D:\develop\git\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/node-red/jsdoc-nr-template.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 命令时,连接到 GitHub 时出现了错误。最可能的原因是您的 SSH 密钥没有被正确添加到 GitHub 帐户中。请确保您已经正确设置了 SSH 密钥,并确保您的 GitHub 帐户中已经添加了该密钥。您可以通过检查您的 SSH 密钥设置和访问权限来解决这个问题。如果问题仍然存在,请尝试使用 HTTPS 而不是 SSH 进行访问。
阅读全文
相关推荐















