Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Conversation

Saturate
Copy link
Contributor

@Saturate Saturate commented Nov 14, 2017

This minor commit adds support for the noProxy configuration.

All whats really needed is passing the option to the pacote package,
this will pass it to make-fetch-happen.

pacote: https://github.com/zkat/pacote/blob/latest/lib/util/opt-check.js#L26
make-fetch-happen: https://github.com/zkat/make-fetch-happen#opts-no-proxy

Fixes #18350, #7168

This minor commit adds support for the noProxy configuration.

All whats really needed is passing the option to the `pacote` package,
this will pass it to `make-fetch-happen` and finally to the `request`
package where this is implemented.

Fixes npm#18350, npm#7168
@Saturate Saturate requested a review from a team as a code owner November 14, 2017 16:06
@jacobjuul
Copy link

+1 👍

@iarna
Copy link
Contributor

iarna commented Nov 17, 2017

make-fetch-happen doesn't use request, it uses http-proxy-agent and https-proxy-agent in conjunction with node-fetch-npm. I don't see mention of this option in the docs for any of those… have you verified that this patch actually works?

@Saturate
Copy link
Contributor Author

No idea where I got that from, maybe it was used in an old npm version? I tested it and it worked, but with this I'll just reconfirm it :-) However make-fetch-happen has documentation on this feature so I'm pretty sure it works :-) also if request is out of the picture.

@Saturate
Copy link
Contributor Author

Saturate commented Nov 20, 2017

@iarna Tested again and it works.

@Saturate
Copy link
Contributor Author

Saturate commented Dec 19, 2017

Any feedback on this @iarna ?

@sebinsua
Copy link

Is anybody going to look at this at some point? I'd prefer not to have to switch to yarn.

@Saturate
Copy link
Contributor Author

Saturate commented Jan 22, 2018 via email

@FabienDehopre
Copy link

I just test this PR in my environment where we use a private repo for our private dependencies.
This private repo in inside our network and NPM has to bypass the proxy to access it.
Everything work fine with this PR.
We used to use environment variables to set the proxy configuration (HTTP_PROXY, HTTPS_PROXY and NO_PROXY) but since a few updates, this does not work anymore so this PR is very important for us.

@thecontrarycat
Copy link

+1 from me. I need NPM to work with an external proxy and a local registry and we can't use the environment variables because that breaks git (which needs to talk to a local git server) and other things.

@jacobjuul
Copy link

Eagerly awaiting this as well

@Saturate
Copy link
Contributor Author

@sebinsua as far a I know Yarn does not support this? But maybe I should create a PR for them as well.

@sebinsua
Copy link

sebinsua commented Feb 12, 2018

as far a I know Yarn does not support this? But maybe I should create a PR for them as well.

@Saturate They only support the NO_PROXY environment variable in the pre-release of 1.4.1. They don't yet support a configuration option of noProxy and, in fact, setting any of the proxy configuration via config stops the fallback to the environment variables. However, I've been able to achieve what I need by just using the environment variables.

@jacobjuul
Copy link

@iarna did you have a chance to review this?

@Saturate
Copy link
Contributor Author

@sebinsua thanks, I'll take a look at it soon, if this goes no further as it would help me with a lot of the big corporate environments where they lock most things down, and everything has to be proxied.

@wvandeneede
Copy link

+1 👍

Copy link
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it 😎

Thanks for the patch! I added this a whiiiile back to make-fetch-happen/pacote, but obviously never got around to integrating it with npm itself. Thanks for your patience while we managed to get around to going through all these PRs!

@zkat zkat changed the base branch from latest to release-next March 8, 2018 08:39
@zkat zkat merged commit 81c5a7d into npm:release-next Mar 8, 2018
@zkat
Copy link
Contributor

zkat commented Mar 8, 2018

For the rest of y'all: npm has supported the environment variable NO_PROXY for a while, so if you don't have this patch, you can still set your no-proxy config by using that env var instead of an npm arg (NO_PROXY="..." npm install ...)

zkat pushed a commit that referenced this pull request Mar 8, 2018
This commit adds support for the noProxy configuration.

All whats really needed is passing the option to the `pacote` package,
this will pass it to `make-fetch-happen` and finally to the `request`
package where this is implemented.

Fixes: #18350
Fixes: #7168
PR-URL: #19157
Credit: @Saturate
Reviewed-By: @zkat
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants