From cc4c5187ed2204d7dfef9b409234ae23bc9b198d Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Mon, 9 May 2016 10:58:30 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/issues/6648 PR-URL: https://github.com/nodejs/node/pull/6658 Reviewed-By: Anna Henningsen Reviewed-By: Jeremiah Senkpiel Reviewed-By: Ben Noordhuis --- test/parallel/test-npm-install.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index 0c2e4df52f9863..b6ef67bf322ea3 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -33,7 +33,10 @@ const pkgPath = path.join(common.tmpDir, 'package.json'); fs.writeFileSync(pkgPath, pkgContent); const proc = spawn(process.execPath, args, { - cwd: common.tmpDir + cwd: common.tmpDir, + env: { + PATH: path.dirname(process.execPath) + } }); function handleExit(code, signalCode) {