• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ethusdt
0.01D
V2EX  ›  程序员

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

  •  
  •   ethusdt · May 22, 2022 · 2912 views
    This topic created in 1634 days ago, the information mentioned may be changed or developed.

    代理设置如下:

    ➜  ~ 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
    └─ [email protected]
    ✨  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 的命令都会先提示一下网络问题重试, 然后才能进行安装, 安装完成后还会提示两三次网络问题. 最后才完成.

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

    Supplement 1  ·  May 22, 2022
    尝试过设置 yarn 的代理, 但会让 yarn 连接不上服务器:

    $ yarn config set https-proxy http://localhost:7890
    15 replies  •  2022-05-23 19:52:49 +08:00
    justin2018
    justin2018
    May 22, 2022
    1
    跟楼主差不多 但是开了增强模式

    ![JIhc3Tu]( )
    ptyfork
    ptyfork
    May 22, 2022
    2
    一个代理端口可以同时是 http 代理和 socks5 代理?
    PlG5sBkXD1ziLeGB
    PlG5sBkXD1ziLeGB
    May 22, 2022 via iPhone
    3
    一样,蹲一个解决办法
    nzbin
    nzbin
    May 22, 2022
    4
    最近也遇到这个问题了,之前一直好好的,目前把 proxy 删掉好了
    ethusdt
    ethusdt
    OP
    May 22, 2022
    5
    @nzbin 很多时候是需要挂代理加速的..
    ethusdt
    ethusdt
    OP
    May 22, 2022
    6
    @ptyfork clashxpro 是有 Mixed proxy port 的.
    ChrisFreeMan
    ChrisFreeMan
    May 22, 2022 via iPhone
    7
    最近两天我用了一年的🪜突然开始不稳定了,用 Safari 访问一些网站开始无法范围,弹出黑色页面报错很奇怪
    lostberryzz
    lostberryzz
    May 22, 2022
    8
    没有必要设置 no_proxy ,一般交给是 clash 来处理
    raykle
    raykle
    May 22, 2022
    9
    我一直这么用的,yarn 也没遇到过问题

    byj66
    byj66
    May 23, 2022 via iPhone
    10
    可能是 node 版本导致的。我用 14 以上的版本就会出现这种情况,使用 14 版本的就没有问题
    Hyoban
    Hyoban
    May 23, 2022
    11
    不手动配代理,直接开启增强模式就好了,特定情况下关闭增强模式即可
    FreshOldMan
    FreshOldMan
    May 23, 2022
    12
    目测是你的 proxy 本身的问题
    sleepm
    sleepm
    May 23, 2022
    13
    翻下 clash 日志,有可能 yarn 的规则是直连,或者线路有问题
    omaidb
    omaidb
    May 23, 2022 via iPhone
    14
    @justin2018 你这图好漂亮,你这是在哪配置的啊,能指导下吗
    justin2018
    justin2018
    May 23, 2022
    15
    @omaidb

    Ray.so by Raycast — Create beautiful images of your code
    https://ray.so/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3373 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 10:10 · PVG 18:10 · LAX 02:10 · JFK 05:10
    ♥ Do have faith in what you're doing.