This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
npm install with proxy config triggers username + password auth requirment in proxy server although curl and web browser do not #18735
Labels
I'm opening this issue because:
What's going wrong?
Using npm (through windows cmd) behind a proxy that does not require username + password authentication with the following npm config results in the proxy denying npm cli the request and requesting username + password authentication.
Requesting the same npm using curl (in git bash) does not trigger the proxy to interfere and the http request is processed as expected. The response json is identical to the json you get accessing http://registry.npmjs.org/[somepackage] directly through the browser.
How can the CLI team reproduce the problem?
npm install [somepackage]
compare with:
curl -k -L --proxy [proxy-host]:[proxy-port] http://registry.npmjs.org/[somepackage] -o [somepackage].json
supporting information:
npm config get registry
prints:http://registry.npmjs.org/
npm config adjustments:
OS: Windows 7
Network:
npm-debug.log of running
npm install htmlparser
:The request by npm seems to be forwarded to a second proxy with a different proxy port and some url rewriting whereas the request made by curl does not. I would expect both http get requests made by npm and curl to be identical and thus resulting in the same behaviour of the proxy. Since I can download the htmlparser json from the registry with other tools (like my web browser), it seems to be a proxy configuration issue within npm that somehow creates a different request than the one curl or my web browser create. But I am by no means sure ;-) So, if you have other suggestions where to look for clues to explain and fix this inconsistent behaviour, let me know.
The text was updated successfully, but these errors were encountered: