Yarn ignores proxy settings

Viewed 34195

I try to get a build job running using yarn and react-native on a windows 10 machine. The following commands are executed inside of jenkins to prepare the actual build of a native Windows app.

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 

This leads to the following output although the proxy settings are correct (tried "http://192.109.190.88:8080/" as well):

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...

Any ideas on why this happens are well appreciated.

3 Answers

yarn version 2 requires a different variable name:

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

I had the same issue and solved by following steps:

Run the following terminal command

  1. npm cache clean --force
  2. set http_proxy=
  3. set https_proxy=
  4. Yarn config delete proxy
  5. Npm config rm https-proxy
  6. Npm config rm proxy
  7. Restart your terminal
  8. yarn
  9. Yarn –network-timeout 100000
  10. Restart your terminal

it worked for me.

Related