在 iTerm2 中配置了 proxy 后, 使用 yarn 命令总是会提示 "There appears to be trouble with your network connection"

2022-05-22 22:21:31 +08:00
 FaiChou

代理设置如下:

➜  ~ env | grep -i proxy
no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com
NO_PROXY=localhost,127.0.0.1,localaddress,.localdomain.com
https_proxy=http://127.0.0.1:7890
http_proxy=http://127.0.0.1:7890
all_proxy=socks5://127.0.0.1:7890

测试命令:

$ yarn add react-native-geolocation-service
yarn add v1.22.17
[1/4] 🔍  Resolving packages...
info There appears to be trouble with your network connection. Retrying...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
info All dependencies
└─ react-native-geolocation-service@5.3.0-beta.4
✨  Done in 5.22s.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

任何使用 yarn add 的命令都会先提示一下网络问题重试, 然后才能进行安装, 安装完成后还会提示两三次网络问题. 最后才完成.

虽然不影响安装, 但每次这样会浪费点时间.

1661 次点击
所在节点    程序员
15 条回复
justin2018
2022-05-22 22:26:48 +08:00
跟楼主差不多 但是开了增强模式

![JIhc3Tu]( )
ptyfork
2022-05-22 22:26:50 +08:00
一个代理端口可以同时是 http 代理和 socks5 代理?
yyf1234
2022-05-22 22:30:42 +08:00
一样,蹲一个解决办法
nzbin
2022-05-22 22:36:42 +08:00
最近也遇到这个问题了,之前一直好好的,目前把 proxy 删掉好了
FaiChou
2022-05-22 22:39:41 +08:00
@nzbin 很多时候是需要挂代理加速的..
FaiChou
2022-05-22 22:40:27 +08:00
@ptyfork clashxpro 是有 Mixed proxy port 的.
ChrisFreeMan
2022-05-22 22:40:54 +08:00
最近两天我用了一年的🪜突然开始不稳定了,用 Safari 访问一些网站开始无法范围,弹出黑色页面报错很奇怪
lostberryzz
2022-05-22 22:50:33 +08:00
没有必要设置 no_proxy ,一般交给是 clash 来处理
raykle
2022-05-22 23:50:49 +08:00
我一直这么用的,yarn 也没遇到过问题

byj66
2022-05-23 09:04:30 +08:00
可能是 node 版本导致的。我用 14 以上的版本就会出现这种情况,使用 14 版本的就没有问题
Hyoban
2022-05-23 09:44:03 +08:00
不手动配代理,直接开启增强模式就好了,特定情况下关闭增强模式即可
FreshOldMan
2022-05-23 09:55:10 +08:00
目测是你的 proxy 本身的问题
sleepm
2022-05-23 17:39:19 +08:00
翻下 clash 日志,有可能 yarn 的规则是直连,或者线路有问题
omaidb
2022-05-23 19:41:38 +08:00
@justin2018 你这图好漂亮,你这是在哪配置的啊,能指导下吗
justin2018
2022-05-23 19:52:49 +08:00
@omaidb

Ray.so by Raycast — Create beautiful images of your code
https://ray.so/

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/854565

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX