Skip to content

Commit

Permalink
fix(yarn): passthrough NODE_OPTIONS env var to yarn install
Browse files Browse the repository at this point in the history
closes TryGhost#1898
- passthrough NODE_OPTIONS env var to yarn install if set
  • Loading branch information
acburdine committed Nov 12, 2024
1 parent ce434a9 commit b87dba4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/tasks/yarn-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,16 @@ module.exports = function yarnInstall(ui, archiveFile) {
args.push('--ignore-engines');
}

const env = {NODE_ENV: 'production', YARN_IGNORE_PATH: 'true'};
// #1898: pass through NODE_OPTIONS so max_old_space_size can be configured
// in memory-constrained environments
if (process.env.NODE_OPTIONS) {
env.NODE_OPTIONS = process.env.NODE_OPTIONS;
}

const observable = yarn(args, {
cwd: ctx.installPath,
env: {NODE_ENV: 'production', YARN_IGNORE_PATH: 'true'},
env,
observe: true,
verbose: ui.verbose || false
});
Expand Down

0 comments on commit b87dba4

Please sign in to comment.