Skip to content

Commit 0c62bd1

Browse files
Myles Borinsevanlucas
authored andcommitted
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 bddf413 commit 0c62bd1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-npm-install.js

Lines changed: 4 additions & 1 deletion
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)