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

Commit 66d1828

Browse files
bfarias-godaddyiarna
authored andcommitted
config: expose "node-options" passthrough for lifecycle scripts
Credit: @bmeck Reviewed-By: @iarna PR-URL: #19104
1 parent 6003b41 commit 66d1828

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

doc/misc/npm-config.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,15 @@ Any "%s" in the message will be replaced with the version number.
656656

657657
The registry you want to send cli metrics to if `send-metrics` is true.
658658

659+
### node-options
660+
661+
* Default: null
662+
* Type: String
663+
664+
Options to pass through to Node.js via the `NODE_OPTIONS` environment
665+
variable. This does not impact how npm itself is executed but it does
666+
impact how lifecycle scripts are called.
667+
659668
### node-version
660669

661670
* Default: process.version

lib/config/defaults.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
176176
maxsockets: 50,
177177
message: '%s',
178178
'metrics-registry': null,
179+
'node-options': null,
179180
'node-version': process.version,
180181
'offline': false,
181182
'onload-script': false,
@@ -309,6 +310,7 @@ exports.types = {
309310
maxsockets: Number,
310311
message: String,
311312
'metrics-registry': [null, String],
313+
'node-options': [null, String],
312314
'node-version': [null, semver],
313315
offline: Boolean,
314316
'onload-script': [null, String],

lib/config/lifecycle.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function lifecycleOpts (moreOpts) {
1818
ignorePrepublish: npm.config.get('ignore-prepublish'),
1919
ignoreScripts: npm.config.get('ignore-scripts'),
2020
log: log,
21+
nodeOptions: npm.config.get('node-options'),
2122
production: npm.config.get('production'),
2223
scriptShell: npm.config.get('script-shell'),
2324
scriptsPrependNodePath: npm.config.get('scripts-prepend-node-path'),

0 commit comments

Comments
 (0)