Skip to content

Commit

Permalink
install: Support for --no-proxy configuration (npm#19157)
Browse files Browse the repository at this point in the history
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: npm#18350
Fixes: npm#7168
PR-URL: npm#19157
Credit: @Saturate
Reviewed-By: @zkat
  • Loading branch information
Saturate authored and zkat committed Mar 8, 2018
1 parent dcdfdcb commit 1d368e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/misc/npm-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,13 @@ impact how lifecycle scripts are called.

The node version to use when checking a package's `engines` map.

### no-proxy

* Default: null
* Type: String or Array

A comma-separated string or an array of domain extensions that a proxy should not be used for.

### offline

* Default: false
Expand Down
2 changes: 2 additions & 0 deletions lib/config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'progress': !process.env.TRAVIS && !process.env.CI,
proxy: null,
'https-proxy': null,
'no-proxy': null,
'user-agent': 'npm/{npm-version} ' +
'node/{node-version} ' +
'{platform} ' +
Expand Down Expand Up @@ -312,6 +313,7 @@ exports.types = {
'metrics-registry': [null, String],
'node-options': [null, String],
'node-version': [null, semver],
'no-proxy': [null, String, Array],
offline: Boolean,
'onload-script': [null, String],
only: [null, 'dev', 'development', 'prod', 'production'],
Expand Down
1 change: 1 addition & 0 deletions lib/config/pacote.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function pacoteOpts (moreOpts) {
preferOnline: npm.config.get('prefer-online') || npm.config.get('cache-max') <= 0,
projectScope: npm.projectScope,
proxy: npm.config.get('https-proxy') || npm.config.get('proxy'),
noProxy: npm.config.get('no-proxy'),
refer: npm.registry.refer,
registry: npm.config.get('registry'),
retry: {
Expand Down

0 comments on commit 1d368e1

Please sign in to comment.