纱线忽略代理设置

Fel*_*ker 8 jenkins react-native yarnpkg

我尝试在Windows 10机器上使用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 
Run Code Online (Sandbox Code Playgroud)

这会导致以下输出,尽管代理设置是正确的(尝试" 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...
Run Code Online (Sandbox Code Playgroud)

关于为什么会发生这种情况的任

Tip*_*ipu 7

只需按照此链接 https://yarnpkg.com/lang/en/docs/cli/config/ 并删除 https-proxy 即可。


Tho*_*ing 5

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

yarn config set httpProxy http://...
yarn config set httpsProxy http://...
Run Code Online (Sandbox Code Playgroud)

  • 使用纱线配置列表我发现有多个代理设置。我删除所有然后纱线配置设置 https-proxy http://127.0.0.1:3111 然后它恢复正常 (2认同)