Skip to content

Commit

Permalink
fix: always set the YARN_IGNORE_ENGINES env variable (nodejs#738)
Browse files Browse the repository at this point in the history
Fixes: nodejs#737
  • Loading branch information
targos authored May 15, 2019
1 parent 278a6d3 commit c3917aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/create-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ function createOptions(cwd, context) {
options.env['TEMP'] = context.npmConfigTmp;
options.env['TMP'] = context.npmConfigTmp;
options.env['TMPDIR'] = context.npmConfigTmp;
// Explicitly tell yarn to ignore the "engines" field in `package.json`.
// If dependencies of tested modules have set it and CITGM is testing an
// unreleased version of Node.js, this prevents `yarn install` from failing.
options.env['YARN_IGNORE_ENGINES'] = 'true';

if (context.options.nodedir) {
const nodedir = path.resolve(process.cwd(), context.options.nodedir);
Expand Down
1 change: 0 additions & 1 deletion lib/lookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
"prefix": "v",
"maintainers": "SimenB",
"yarn": true,
"envVar": { "YARN_IGNORE_ENGINES": true },
"skip": ["aix"]
},
"esprima": {
Expand Down
1 change: 1 addition & 0 deletions test/test-create-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test('create-options:', (t) => {
env['TEMP'] = 'npm_config_tmp';
env['TMP'] = 'npm_config_tmp';
env['TMPDIR'] = 'npm_config_tmp';
env['YARN_IGNORE_ENGINES'] = 'true';
// Set dynamically to support Windows.
env['npm_config_nodedir'] = path.resolve(process.cwd(), nodePath);

Expand Down

0 comments on commit c3917aa

Please sign in to comment.