[6.5.0] "npm i" doesn't work behind a proxy with no-proxy for local repository

What I Wanted to Do

Wanted to install a new package using a local repository.
I am behind a proxy but my local repository has not to be resolved by the proxy.
repository = http://vpc-nexus.gdaprive.lan/
proxy=http://…
no-proxy=vpc-proxy.gdaprive.lan

What Happened Instead

unable to install package : HTTP 503 Service Unavalaible

Reproduction Steps

.npmrc :
registry=https://vpc-nexus.gdaprive.lan/repository/npm-central/
cafile=C:\KitDevGDA\vpc-nexus-ca.crt
proxy=http://fr-proxy.groupinfra.com:3128/
https-proxy=http://fr-proxy.groupinfra.com:3128/
no-proxy=gdaprive.lan
strict-ssl=false

$ npm i @angular-devkit/build-angular@~0.11.0

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\valentin.giraud\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   '@angular-devkit/build-angular@~0.11.0' ]
2 info using npm@6.5.0
3 info using node@v10.14.1
4 verbose npm-session cfe91809497289ba
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 503 https://vpc-nexus.gdaprive.lan/repository/npm-central/@angular-devkit%2fbuild-angular 70292ms attempt #3
8 silly fetchPackageMetaData error for @angular-devkit/build-angular@~0.11.0 503 Service Unavailable: @angular-devkit/build-angular@~0.11.0
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 72019ms
11 verbose stack Error: 503 Service Unavailable: @angular-devkit/build-angular@~0.11.0
11 verbose stack     at fetch.then.res (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
11 verbose stack     at tryCatcher (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
11 verbose stack     at Promise._settlePromiseFromHandler (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
11 verbose stack     at Promise._settlePromise (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
11 verbose stack     at Promise._settlePromise0 (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
11 verbose stack     at Promise._settlePromises (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:694:18)
11 verbose stack     at _drainQueueStep (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:138:12)
11 verbose stack     at _drainQueue (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
11 verbose stack     at Async._drainQueues (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
11 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\valentin.giraud\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
11 verbose stack     at runCallback (timers.js:705:18)
11 verbose stack     at tryOnImmediate (timers.js:676:5)
11 verbose stack     at processImmediate (timers.js:658:5)
12 verbose cwd C:\Users\valentin.giraud\Documents\test
13 verbose Windows_NT 10.0.14393
14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\valentin.giraud\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "@angular-devkit/build-angular@~0.11.0"
15 verbose node v10.14.1
16 verbose npm  v6.5.0
17 error code E503
18 error 503 Service Unavailable: @angular-devkit/build-angular@~0.11.0
19 verbose exit [ 1, true ]

Details

workarround : this command works using NPM version 6.4.1 or setting environment variable “NO_PROXY” to “vpc-proxy.gdaprive.lan”

Platform Info

$ npm --versions
{ npm: '6.5.0',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.14.1',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.36',
  zlib: '1.2.11' } 
$ node -p process.platform
win32 

Does it work if you change no-proxy to noproxy

1 Like

Yes it works ! :slight_smile:

1 Like

This was actually a bug beforeno-proxy doesn’t actually work quite as expected when it comes to our config parsing system, so it was changed to be noproxy to avoid the boolean parsing logic. Things should work right if you remove the hyphen.

1 Like

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