Skip to content

Commit cc4c518

Browse files
author
Myles Borins
committed
test: ensure test-npm-install uses correct node
Currently it is possible that the shelled out instance of npm will use the system copy of node. This PR changes the test to shim the build directory into the path. This will ensure that npm will use the correct version of node. fixes: #6648 PR-URL: #6658 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 3c50350 commit cc4c518

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-npm-install.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ const pkgPath = path.join(common.tmpDir, 'package.json');
3333
fs.writeFileSync(pkgPath, pkgContent);
3434

3535
const proc = spawn(process.execPath, args, {
36-
cwd: common.tmpDir
36+
cwd: common.tmpDir,
37+
env: {
38+
PATH: path.dirname(process.execPath)
39+
}
3740
});
3841

3942
function handleExit(code, signalCode) {

0 commit comments

Comments
 (0)