You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] NPM 10 ignores proxy configuration via environment variables #6835
$ docker run -it --entrypoint bash node@sha256:14bd39208dbc0eb171cbfb26ccb9ac09fa1b2eba04ccd528ab5d12983fd9ee24
root@4c9745d8fc3c:/# node --version
v20.6.1
root@4c9745d8fc3c:/# npm --version
9.8.1
root@4c9745d8fc3c:/# npm cache clean --force && HTTPS_PROXY=http://invalid npm install --global leftpad
npm WARN using --force Recommended protections disabled.
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/leftpad failed, reason: getaddrinfo ENOTFOUND invalid
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-09-25T15_11_42_520Z-debug-0.log
Seeing the same issue. We're setting http_proxy and https_proxy environment variables, but npm ignores the configuration.
code ETIMEDOUT
errno ETIMEDOUT
network request to https://npm.fontawesome.com/@fortawesome/react-fontawesome/-/XXX/react-fontawesome-xxxxx.tgz failed, reason:
network This is a problem related to network connectivity.
network In most cases you are behind a proxy or have bad network settings.
network
ERR! network If you are behind a proxy, please make sure that the
network 'proxy' config is set properly. See: 'npm help config'
A complete log of this run can be found in: /build/.npm/_logs/2023-09-25T14_17_20_257Z-debug-0.log
Reverting to node 18 and npm 9.8.1 solves the issue.
@wraithgar@lukekarrys As you have worked on the make-fetch-happen PR, could you maybe support here a bit? Sorry for pinging, but it's quite a severe regression and I assume it breaks many builds.
Just wanted to mention that node 20 which just became LTS still ships with npm 10.1 and is affected by this issue. This is blocking as we can only use LTS releases. Should the fix be backported or the npm package be updated to 10.2 inside the node distribution?
Activity
[-][BUG] NPM not [/-][+][BUG] NPM 10 ignores proxy configuration via environment variables[/+]fgreinacher commentedon Sep 25, 2023
This regression is probably caused by npm/make-fetch-happen#255
CoaxVex commentedon Sep 26, 2023
Seeing the same issue. We're setting http_proxy and https_proxy environment variables, but npm ignores the configuration.
Reverting to node 18 and npm 9.8.1 solves the issue.
fgreinacher commentedon Sep 26, 2023
@wraithgar @lukekarrys As you have worked on the
make-fetch-happenPR, could you maybe support here a bit? Sorry for pinging, but it's quite a severe regression and I assume it breaks many builds.lukekarrys commentedon Sep 26, 2023
Thanks for the ping @fgreinacher, I will take a look at this.
Abukodonosor commentedon Sep 26, 2023
lenaing commentedon Sep 28, 2023
For those who are looking for a workaround (not always a solution, depends on your context, only if you really don't rely on environment variables) :
Unlocked us behind a corporate proxy with authentication :)
fix: set proxy from env vars based on truthiness
fix: set proxy from env vars based on truthiness
deps: @npmcli/agent@2.2.0
deps: @npmcli/agent@2.2.0
deps: @npmcli/agent@2.2.0
lscorcia commentedon Oct 24, 2023
Just wanted to mention that node 20 which just became LTS still ships with npm 10.1 and is affected by this issue. This is blocking as we can only use LTS releases. Should the fix be backported or the npm package be updated to 10.2 inside the node distribution?
[node] - Install pnpm as non-root user to prevent root-owned npm cache (
fix(dev-platform): deterministic instant-reject for any egress bypass…