侧边栏壁纸
博主头像
王小木人

这是很长,很好的一生

  • 累计撰写 141 篇文章
  • 累计创建 43 个标签
  • 累计收到 8 条评论

目 录CONTENT

文章目录

npm install 报错 npm ERR! Connection reset by 20.205.243.166 port 22

王小木人
2023-10-30 / 0 评论 / 0 点赞 / 991 阅读 / 221 字

github 拉下的开源项目,执行 npm install 后报错如下
image

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! Connection reset by 20.205.243.166 port 22
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.

按网上方法

  1. 增加淘宝镜像 (失败)
  2. 重新生成ssh密钥,并在github 添加(失败)
  3. 替换git方式为https (失败)
    最后通过修改ssh下config 文件得到解决
    文件路径 C:\Users\Administrator.ssh 目录下的 config 文件
    我的路径下没有这个文件,所以我手动新建了一个,后缀改为.config
    image-1698646512186
    添加以下内容
Host github.com
    User git
    ProxyCommand connect -H 127.0.0.1:7890 %h %p

重新npm install 之后就不会再报这个错误了

0

评论区