-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] NPM v10.0.0 fails to communicate correctly with HTTP proxy (HTTP 400) #6760
Closed
2 tasks done
Labels
Comments
aureq
added
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 9.x
work is associated with a specific npm 9 release
labels
Sep 3, 2023
Have the same issue. Had to rollback |
lukekarrys
added
Priority 0
will get attention right away
and removed
Needs Triage
needs review for next steps
labels
Sep 6, 2023
saquibkhan
added
Release 10.x
and removed
Release 9.x
work is associated with a specific npm 9 release
labels
Sep 6, 2023
lukekarrys
added a commit
that referenced
this issue
Sep 7, 2023
lukekarrys
added a commit
to npm/agent
that referenced
this issue
Sep 7, 2023
This matches the old behavior of `make-fetch-happen@11.1.1`[1] where the proxy agent was determined based on the original request url. Fixes npm/cli#6760 [1]: https://github.com/npm/make-fetch-happen/blob/eb4a83806e9deb7e441c8f2f6a673f929055a5eb/lib/agent.js#L195C1-L195C1
wraithgar
pushed a commit
to npm/agent
that referenced
this issue
Sep 8, 2023
This matches the old behavior of `make-fetch-happen@11.1.1`[1] where the proxy agent was determined based on the original request url. Fixes npm/cli#6760 [1]: https://github.com/npm/make-fetch-happen/blob/eb4a83806e9deb7e441c8f2f6a673f929055a5eb/lib/agent.js#L195C1-L195C1
lukekarrys
added a commit
that referenced
this issue
Sep 8, 2023
This is fixed in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Part of my work environment, I'm regularly updating
nodejs
(stable) andnpm
(latest via https://www.npmjs.com/install.sh). That same work environment requires me to use a proxy in order to access the Internet (see config below).As part of my setup, I install core npm packages such as
eslint
andtypescript-eslint
(latest versions) globally onto my system. I do so by runningnpm install -g 'typescript-eslint@latest' --verbose --debug
However, as of npm v10.0.0 released 2 days ago, I'm unable to download & install my required packages. The npm command returns:
Digging further, it appears npm 10.0.0 sends the following query to the proxy
Squid-cache (proxy) store the query in its log as, which shows the HTTP/400 error code being returned to the client (npm).
However, installing nodejs 18.7.1 and keeping the bundled npm version (npm@9.6.7) doesn't trigger the issue. The proxy log contains a different type of connection.
I also upgraded to node v20.5.1 and kept the bundled npm (9.8.0) and it worked fine.
Here is a table to detail my tests and results
GET http://registry.npmjs.org:443/typescript-eslint
npm ERR! 400 Bad Request - GET https://registry.npmjs.org/typescript-eslint
CONNECT registry.npmjs.org:443
CONNECT registry.npmjs.org:443
Expected Behavior
NPM 10.0.0 should be able to download and install packages when using a proxy.
Steps To Reproduce
npm config set proxy "$HTTP_PROXY" && npm config set https-proxy "$HTTPS_PROXY"
wget -O - https://www.npmjs.com/install.sh | sh
npm install -g 'typescript-eslint@latest' --verbose --debug
The last command fails with a HTTP/400 error.
Run the command above but skip step 3 and the last command succeeds.
Environment
The text was updated successfully, but these errors were encountered: