jenkins Yarn忽略代理设置

nimxete2  于 2022-11-01  发布在  Jenkins
关注(0)|答案(3)|浏览(211)

我尝试在windows10机器上使用yarn和react-native运行一个构建作业,下面的命令在jenkins内部执行,以准备实际构建一个原生Windows应用。

yarn config set proxy http://192.109.190.88:8080 
yarn config set https-proxy http://192.109.190.88:8080 
yarn add react-native

尽管代理设置是正确的(也尝试了“http://192.109.190.88:8080/“),但这会导致以下输出:

yarn add v0.27.5
[1/4] Resolving packages...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...

任何关于为什么会发生这种情况的想法都是非常感谢的。

wwodge7n

wwodge7n1#

Yarn版本2需要不同的变量名称:

yarn config set httpProxy http://...
yarn config set httpsProxy http://...
t5fffqht

t5fffqht2#

只要按照这个链接https://yarnpkg.com/lang/en/docs/cli/config/和删除https代理,它为我工作。

t5fffqht

t5fffqht3#

我遇到了同样的问题,并通过以下步骤解决:
运行以下终端命令

  1. npm缓存清除--强制
    1.设置http代理=
    1.设置https代理=
    1.Yarn配置删除代理
  2. npm配置rm https代理
  3. npm配置rm代理
    1.重新启动终端
    1.Yarn
    1.Yarn-网络-超时100000
    1.重新启动终端
    对我很有效。

相关问题