-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install package manager behind a corporative proxy #67
Comments
At the moment there is no configuration for proxies, but it'd be nice to have |
Can I help you with this? |
For sure! This is the place where we handle https queries; adding support for HTTPS_PROXY there would be appreciated: https://github.com/nodejs/corepack/blob/main/sources/httpUtils.ts#L11-L23 |
I think we could use https://github.com/gajus/global-agent. And https://github.com/np-maintain/global-tunnel if we need to support node < 10 (I didn't found info about node versions supported by corepack) |
So, I have a two questions:
|
I'd go with no, as those version are past LTS.
Env variables are fine, but I'd prefer to hold off on complexifying the configuration by reading the |
Hi, there! I'm having the same problem here. I've installed corepack, enabled it, but can't run yarn. Always get this "Error when performing the request" error, and i'm behind a proxy. Was this problem solved? Thanks! |
@BrunoMBento PR with proxy support is created, it only needs to be merged |
Thanks a lot, @Djaler ! |
Same problem, with proxy configured in the environment: node: v16.13.2
|
I have the same error. Does anyone know any workaround? Thanks! |
Same problem here. |
Any updates on this? By the way, @icyerasor , if I disable the Any other alternative ways? |
I had the "Internal Error: Error when performing the request" at "corepack.js:3937:20" like everyone who's been here so I looked in line 3937 and discovered it was a vanilla https.get call. I stuck in some extra debugging and discovered it was failing trying to reach "https://registry.npmjs.com/pnpm". I navigated to "https://registry.npmjs.com/pnpm" in my web browser and discovered my corporate environment let it load up with no errors. So I fired up Node JS and issued to see what would happen:
I received a "unable to get local issuer certificate" error. In my corporate environment, there's a security solution that injects it's own self-signed certificates into responses from any outbound https requests. What that means for me is that I need to instruct anything issuing https requests (eg Node.js and curl) to use a custom CA certificate file. To get corepack to work, I first hard-coded a custom CA certificate file into corepack.js and while it's pretty ugly, it did work. A bit of further digging around I found the NODE_EXTRA_CA_CERTS environment variable option used by Node.js so also tried the following in a Administrator-privileged cmd session with success (also removing the corepack.js hack I made earlier):
The combo.ca.cer was constructed by navigating to https://registry.npmjs.com/pnpm and exporting all the CA certs (root and any intermediate CA certs) to text files and copy-pasting the contents of all the CA cert files into a single text file called combo.ca.cer. I used advice from https://stackoverflow.com/a/44726189 to create my custom CA cert file. |
In case it helps anyone, our firewall blocks any tarball or exe and while debugging I noticed an attempt on 'https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz' which is causing this error in our case. |
In case anyone missed it, as of Corepack 0.11.0, |
I'd love any advice that anyone has for using |
Could you elaborate a little bit? I am behind proxy,
|
I would also be interested in some tips on how to use proxy-agent with corepack. |
As of Corepack 0.26.0, we're now using |
Thanks for your help! I'll open a new issue. |
corepack 0.28.2 appears to have several remaining glitches concerning proxies / certificate chains.
|
I tried to do, as instance
corepack prepare [email protected]
, but gotInternal Error: Error when performing the request
.I think this is because of the proxy. Where I can configure it?
I have proxy setting in
.npmrc
, also I haveHTTP_PROXY
andHTTPS_PROXY
environment variablesThe text was updated successfully, but these errors were encountered: