npm 报错ERR Host key verification failed.

这篇具有很好参考价值的文章主要介绍了npm 报错ERR Host key verification failed.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题

npm install 时报错npm ERR! Host key verification failed.

npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.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! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git
npm ERR! Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
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.

解决方法

将github的ssh链接改为https链接,运行以下命令

# 运行命令
git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"

再运行“npm install”,如果报类似下面的错误:

# 错误信息
npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b 2.2.0-c https://github.com/nhn/raphael.git ******* --config core.longpaths=true
npm ERR! warning: templates not found in C:\Users\****\AppData\Local\Temp\pacote-git-template-tmp\git-clone-75bbee44
npm ERR! error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
npm ERR! fatal: error reading section header 'shallow-info'
npm ERR!

则运行以下命令

# 运行命令
git config -global http.sslVerify "false"

还有其它问题,可能是由于github链接国内访问不稳定,解决方法懂的都懂。文章来源地址https://www.toymoban.com/news/detail-512223.html

到了这里,关于npm 报错ERR Host key verification failed.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • npm install时 node-sass npm ERR command failed问题解决

    出现错误后,找了很多方法,网上关于这个问题的解决方法也很多,尝试了两三天,最后发现了一个终极解决方案, 亲测有效!!! ,下面是链接。 npm install 时 node-sass npm ERR command failed问题解决

    2024年02月15日
    浏览(44)
  • vue-element-admin项目-Host key verification failed.-已解决

    在网上下载的element-admin项目,install的时候一直报错Host key verification failed, 实测好用!!!已解决 报错问题: 上面写到主机密钥验证失败,无法从远程仓库拉取。说明我们需要生成一个新的密钥,然后添加到远程仓库     打开 Git Bash 终端,将下面的文本复制进去执行(使

    2024年02月08日
    浏览(50)
  • npm install运行报错npm ERR! gyp ERR! not ok问题解决

    执行 npm install 的时候报错: 根据报错信息,看出时node-sass运行出现问题 解决: 1.查看当前环境node版本 我这里是20.11.0 2.在package.json中查看node-sass的版本: 2.1package.json中有node-sass 我这里node-sass的版本是4.14.4 根据下图查看node和node-sass版本是否匹配 如果node和node-sass版本不符合

    2024年01月24日
    浏览(46)
  • GitHub提交时出现Host key verification failed无法读取远程仓库的解决方案

    今天提交代码时候发现有这样一个问题: 那么为什么呢? 找了一圈, 发现一篇帖子是最近(两天前写的)由GitHub官方给出的, 如下: We updated our RSA SSH host key; 那么, 就用这个方法试试呗: 解决了~ 重新试试提交: 当然, 我之前还试了添加ssh公钥的方法, 并不奏效, 这里也贴出来吧: (熟悉

    2024年02月11日
    浏览(31)
  • 如何解决npm install 的报错npm ERR! network request to http://registry.cnpmjs.org/vue-cli failed

    报错: 解决方法: npm ERR! network request to http://registry.cnpmjs.org/vue-cli failed, reason: getaddrinfo ENOTFOUND 这句话已经很明显的提示 http://registry.cnpmjs.org/vue-cli 请求失败了,但网上其他博客还是让代理这个路径。试了网上很多方法都没有用。最后执行了以下语句,执行成功 直接代理淘

    2024年02月04日
    浏览(70)
  • 解决npm install报错npm ERR Unsupported URL Type “npm:“: npm:vue-loader@^16.1.0 问题

    node版本以及npm版本太旧会造成这个问题 1.下载安装nvm 网址:Releases · coreybutler/nvm-windows · GitHub 2.安装 后使用nvm命令安装切换node版本 安装node版本: 等待安装完成,使用命令切换版本 3.如遇到切换完版本idea提示无法识别npm命令,重启idea即可

    2024年04月15日
    浏览(77)
  • npm install 出现 npm ERR! command failed 解决办法

    本地使用npm install 时出现如下异常,可以看下本地是否安装过历史版本的node导致的版本冲突。 解决方案: 先将历史版本的 node 卸载,再重新安装后,再执行npm install  转自下面这篇文章 npm install 时 node-sass npm ERR command failed问题解决

    2024年02月12日
    浏览(50)
  • npm install报错npm ERR! code ERESOLVE

    1.npm install报错npm ERR! code ERESOLVE 解决方法 在npm install 后面加上–force或者–legacy-peer-deps 2.npm install 报错 gyp ERR 原因:node和npm版本不匹配 解决方法 1.首先去node官网查找对应版本 node官网版本 2 查看自己电脑的node、npm版本,win+r打开cmd,输入: 卸载原有的高版本node,下载安装

    2024年02月15日
    浏览(41)
  • npm install报错 -> npm ERR! Unexpected token ‘.‘ 报错解决办法。

    问题原因: 用nvm1.1.7的版本安装了16.x以上的node, 然后再下载依赖的时候就报错了; 总结一下就是nvm版本太低了,他的里面没有集成高版本node导致的。 解决办法: 把nvm切换到新版本就行了。 1. 卸载掉当前所有的node 有3个版本的node,我们要nvm uninstall 16.18.1, nvm uninstall 16.12.2…

    2024年02月14日
    浏览(44)
  • npm install报错 -> npm ERR! Unexpected token ‘.‘ 报错解决办法

    问题原因: 用nvm1.1.7的版本安装了16.x以上的node, 然后再下载依赖的时候就报错了; 总结一下就是nvm版本太低了,他的里面没有集成高版本node导致的。 解决办法: 把nvm切换到新版本就行了。 1. 卸载掉当前所有的node 有3个版本的node,我们要nvm uninstall 16.18.1, nvm uninstall 16.12.2…

    2024年02月14日
    浏览(39)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包