3

Recently I've upgraded my node version to 16.15.1. Before the node upgrade I used a 1.x yarn version. Now I want to use yarn v3.2.x in my project.

Normally this would be achieved by executing the command yarn init -2 in the console. This would generate a .yarn/releases folder in my project where the yarn-[version].cjs is stored. Furthermore, in the project .yarnrc.yml the line yarnPath: .yarn/releases/yarn-[version].cjs is added.

However, I have the problem that I work in a closed working environment. When I execute the command yarn init -2 I get problems with the proxy.

This is the error I get:

error An unexpected error occurred: "https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js: connect ECONNREFUSED xxx.x".

I tried to set the proxy in the project and also in the user .yarnrc.yml but both didn't seem to work.

My question is whether there is a possibility to add a proxy url to the yarn init -2 command, e.g. via a cmd flag?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
poisn
  • 437
  • 2
  • 17

1 Answers1

0

Yes, you can specify a proxy to use during installation. Add httpProxy or httpsProxy to yarnrc.yml.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Johan Nordlinder
  • 1,672
  • 1
  • 13
  • 17