--no-proxy missing from npm cli


(Felipe Heidrich) #1

What I Wanted to Do

I’m trying to pass --no-proxy on the npm cli
such as

npm --proxy http://proxy.company.com --no-proxy .company.com install somePackage

What Happened Instead

having that --no-proxy makes npm barf
note that no-proxy is in https://docs.npmjs.com/misc/config
(not the same level of documentation as proxy, specially missing to state (or otherwise):
“no_proxy settings will be honored by the underlying request library”)

I suspect env[NO_PROXY] or putting on .npmrc might work…

Reproduction Steps

Just try
npm --proxy http://proxy.company.com --no-proxy .company.com install somePackage


Platform Info

Mac OSx 10.13.5

try with npm 5.6.0 and 6.2.0 (which I think is the lastest)

here the full --versions
fheidric@fheidric-mac ui$ npm --versions
{ iotui: ‘1.0.0’,
npm: ‘6.2.0’,
ares: ‘1.14.0’,
cldr: ‘33.1’,
http_parser: ‘2.8.0’,
icu: ‘62.1’,
modules: ‘64’,
napi: ‘3’,
nghttp2: ‘1.32.0’,
node: ‘10.8.0’,
openssl: ‘1.1.0h’,
tz: ‘2018e’,
unicode: ‘11.0’,
uv: ‘1.22.0’,
v8: ‘’,
zlib: ‘1.2.11’ }

(Kat Marchán) #2

I thought this was in place, or at least most of the groundwork was laid out. This might be an interesting patch for someone to put together.

(Kat Marchán) #3

update: I just realized this is because --no- get translated to the positive version. So the patch to lib/config/defaults.js we previously affected was wrong and should be noproxy instead. I believe that will fix the bug if anyone’s interested in filing it. :slight_smile:

(Taylor Hodge) #4

I’d love to have a go at fixing this!
What’s the proper protocol for being assigned this bug and opening a PR? :blush:

(Kat Marchán) #5

“I wanna do this” -> go write a PR. It’s very unlikely for you to get preempted :slight_smile:

(SneakyFish5) #6

@jth Oh I’m so sorry, I didn’t realize you were going to take this issue before I opened the PR. That’s completely my bad :frowning:

(Taylor Hodge) #7

No worries, friend! I got a bit tied up at work and wasn’t able to strike while the iron was hot, and that’s alright.
I’m certain there will be more bugs, and as long as the problem’s been resolved, we’re all better off for it.

(Kat Marchán) #8

damnit, y’all. It didn’t even take a day for me to be wrong?!

(SneakyFish5) #9

Finally got CI to work lol! Tyvm for the opportunity, I hope to help out more in the future :slight_smile:

(Kat Marchán) #10

The PR has been merged. This will be included in the next npm release. Thanks, @SneakyFish5

(system) #11

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.