Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

NPM requires http-proxy,https-proxy,proxy set in ~/.npmrc and doesn't fall back to local HTTP proxy settings #1850

Closed
ygreen opened this Issue · 1 comment

2 participants

@ygreen

Currently, NPM requires http-proxy,https-proxy,proxy set in ~/.npmrc and doesn't fall back to system HTTP proxy settings.

If you have already set the system environment settings for http_proxy and https_proxy, NPM operations will fail since NPM seems to rely on internal setting exclusively for its configuration. If you are on a laptop like myself and move around between various networks, this can get very annoying, and is inconsistent with the behavior of pretty much every other command line application or otherwise, that in the absence of an an application level config will fall back to the system configuration for these same values. Ideally NPM should do this as well.

@isaacs
Owner

I think what you're saying is not correct.

  1. http-proxy is not an npm config.
  2. proxy and https-proxy defaults to the environment vars, if set. https://github.com/isaacs/npm/blob/master/lib/utils/config-defs.js#L177-179
  3. This is all described in the docs: http://npmjs.org/doc/config.html#https-proxy and http://npmjs.org/doc/config.html#proxy

Qv:

$ npm -v
1.1.0-alpha-6

$ npm config get https-proxy
null


$ HTTPS_PROXY=https://user:pass@host:1234 !!

$ HTTPS_PROXY=https://user:pass@host:1234 npm config get https-proxy
https://user:pass@host:1234/

$ https_proxy=https://user:pass@host:1234 npm config get https-proxy
https://user:pass@host:1234/

$ npm config get proxy
null


$ HTTPS_PROXY=https://user:pass@host:1234 npm config get proxy
null


$ HTTP_PROXY=https://user:pass@host:1234 npm config get proxy
https://user:pass@host:1234/
@isaacs isaacs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.