npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

noproxy setting with more than one hostname?

Hi all!

I am trying to run npm as build tool of an angular application. Having to work behind a corporate firewall complicates things quite much…

After updating npm (currently 6.7.0) I found a way to set a no-proxy host with --noproxy like:

npm install --noproxy=internalnexushost --registry=http://internalnexushost/foo/bar/

This works fine, however - since having sass as dependency - I have to add also --sass-binary-site=… like:

npm install --noproxy=internalnexushost --registry=http://internalnexushost/foo/bar/ --sass-binary-site=internalartifactory

This fails because the host of sass-binary-site is not excluded from beeing proxied.

I tried:

npm install --noproxy=internalnexushost,internalartifactory
npm install --noproxy=[internalnexushost internalartifactory]

however this did make the complete noproxy setup failing.

How to set more than one non-proxy host? What am I doing wrong?


This might be a bug in make-fetch-happen. I’m wondering if anyone would like to take a look.

Installing with .npmrc:


seems to work fine. As CLI args they fail though.

This code handles possible arrays:

This causes the option to not be split at commas (which it is if it’s in a config file), but it is put in an array. Workaround:

npm install --noproxy=foo --noproxy=bar

Thanks for the quick reply to my initial post.

I tried the workaround with --noproxy=… --noproxy=… , unfortunately it seems to be useless for my usecase, since it does not seem to recognized when the parameter ‘sass-binary-site’ is used during the install process:

[INFO] > node-sass@4.10.0 install C:\path-to-my-project-root\node_modules\node-sass
[INFO] > node scripts/install.js
[INFO] Downloading binary from https://myinternalartifactory/path/to/sass/node-sass/releases/tag/v4.10.0/win32-x64-64_binding.node
[ERROR] Cannot download "https://myinternalartifactory/path/to/sass/node-sass/releases/tag/v4.10.0/win32-x64-64_binding.node":
[ERROR] tunneling socket could not be established, statusCode=407
[ERROR] Hint: If is not accessible in your location
[ERROR]       try setting a proxy via HTTP_PROXY, e.g.
[ERROR]       export HTTP_PROXY=
[ERROR] or configure npm proxy via
[ERROR]       npm config set proxy

The only thing that prevents this error seems to disable the env variables for proxy (http_proxy, https_proxy).
Also, the env var ‘no_proxy’ doesn’ t seem to come in for rescue…

Any other ideas how to get the url provided via ‘sass-binary-site’ to be excluded from proxying? Disabling the global env vars http_proxy, https_proxy is quite a harsh ‘workaround’.


node-sass should support NO_PROXY, but I don’t think npm is actually setting that variable, so I don’t know how that would work at all.