项目 npm 安装依赖时报错: RPC failed; curl 28 OpenSSL SSL_read: Connection was reset

364 阅读1分钟

解决方案:

1.初始化git仓库(新的没有执行过git命令的文件夹,这一步必须要,已有.git目录的跳过)

git init

2.执行命令:

git config http.sslVerify "false"

如果还出现这个错误:

企业微信截图_16536356566455.png

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

解决方案:

1.可以清除DNS 执行命令 ipconfig /flushdns

ipconfig /flushdns

2.在执行 npm install --registry=registry.npm.taobao.org 使用淘宝镜像

npm install --registry=https://registry.npm.taobao.org