关于终端无法连接神奇魔法的问题
本文最后更新于 53 天前,其中的信息可能已经有所发展或是发生改变。

唉,太坏了,Github

在一个风不和日可能丽的下午,我一如既往的准备更新项目的依赖

pnpm install --frozen-lockfile

但是却遇到了

PS D:\喵喵喵喵喵喵喵喵喵喵喵喵> pnpm install --frozen-lockfile Lockfile is up to date, resolution step is skipped Packages: +1331 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ERROR  Command failed with exit code 128:
git -c core.longpaths=true fetch --depth 1 origin 06b29aafb7708acef8b3669835c8a7857ebc92d2 git@github.com: Permission denied (publickey). 
fatal: Could not read from remote repository. 
Please make sure you have the correct access rights and the repository exists. 
pnpm: Command failed with exit code 128: 
git -c core.longpaths=true fetch --depth 1 origin 06b29aafb7708acef8b3669835c8a7857ebc92d2 git@github.com: 
Permission denied (publickey). fatal: Could not read from remote repository. 
Please make sure you have the correct access rights and the repository exists. 
at makeError (C:\Users\喵喵喵喵喵喵喵喵喵喵喵喵\dist\pnpm.cjs:14934:17) at handlePromise 
...
Progress: resolved 1331, reused 1330, downloaded 0, added 1330

于是乎我就开始不使用校园网啊,在魔法小蓝猫(这是一个朋友的名字)和手机热点的帮助下,开始重新下载,但是还是出现了类似的问题捏

这么厉害?

同像普通人一样,遇到问题先:重启,重新安装,检查环境配置,用力猛拍电脑,对着朋友撒泼打滚发电,对着电脑屏幕嘶吼,我终于意识到一个问题

上个学期,在学校批判性使用西方很坏的 Github 时,我配置了 SSH 直连而不是 HTTPS,而 pnpm-lock.yaml 文件有可能使用的就是 SSH 地址,我怀疑可能是 SSH 失效了,就重新配置了一份…
但折腾了快一个下午完全没有效果捏

我们才不跟什么难题死耗,沙耶之歌,启动!

太坏了,SSH

实在不行就不走 SSH 了呗,先让我狠狠查查配置:

git config --global --get-regexp insteadOf

输出:

url.git@github.com:.insteadof https://github.com/
url.https://github.com/.insteadof git@github.com:
(1:将 SSH 转为 HTTPS,2:将 HTTPS 转为 SSH)

怎会如此… 唉,搬屎。看我火速移除!

git config --global --unset url.git@github.com:.insteadOf

现在,执行 git config --global --get-regexp insteadOf 就只显示第一个啦!
赫赫,pnpm install --frozen-lockfile 启动!

PS D:\喵喵喵喵喵喵喵喵喵喵喵喵> pnpm install --frozen-lockfile Lockfile is up to date, resolution step is skipped Packages: +1457 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
 ERROR  Command failed with exit code 128:
git -c core.longpaths=true fetch --depth 1 origin 06b29aafb7708acef8b3669835c8a7857ebc92d2 fatal: unable to access 
'https://github.com/electron/node-gyp.git/': Recv failure: Connection was reset pnpm: 
Command failed with exit code 128: git -c core.longpaths=true fetch --depth 1 origin 06b29aafb7708acef8b3669835c8a7857ebc92d2 fatal: unable to access 
'https://github.com/electron/node-gyp.git/': Recv failure: Connection was reset at makeError
(C:\喵喵喵喵喵喵喵喵喵喵喵喵\pnpm.cjs:14934:17) at handlePromise
...
Progress: resolved 0, reused 1330, downloaded 0, added 1452

原来网络连接都是有问题的吗?!

唉,唉唉,唉唉唉

起码走了 HTTPS (Permission denied (publickey) 冇了)那么来收拾剩下的烂摊子吧!
这里可以测试是不是真的网络问题:
git ls-remote https://github.com/electron/node-gyp.git

好的,狠狠的查出来了,怎么解决呢?只能走镜像!问题结束!

以下内容是胡乱生成的

git config --global --get http.proxy

如果什么也没显示,那就说明你的网络非常干净啊。如果配置错误,清理掉

git config --global --unset http.proxy

魔法小蓝猫说
git config --global http.proxy http://127.0.0.1:7890
为什么是 7890 呢?因为他说是他的默认端口是 7890 当然你可以改的

然后就可以了!忠诚!感恩!

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇