Skip to content
Browse files

add the directory containing the `node` executable currently running …

…to the PATH for lifestyle scripts

Fixes #2680.
  • Loading branch information...
1 parent 9cb4f73 commit 167bd541bbdd5f39b351a5f928708295a5b67828 @TooTallNate committed Aug 7, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/utils/lifecycle.js
View
4 lib/utils/lifecycle.js
@@ -78,6 +78,10 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) {
// the bundled one will be used for installing things.
pathArr.unshift(path.join(__dirname, "..", "..", "bin", "node-gyp-bin"))
+ // add the directory containing the `node` executable currently running, so
+ // that any lifecycle script that invoke "node" will execute this same one.
+ pathArr.unshift(path.dirname(process.execPath))
+
if (env[PATH]) pathArr.push(env[PATH])
env[PATH] = pathArr.join(process.platform === "win32" ? ";" : ":")

0 comments on commit 167bd54

Please sign in to comment.
Something went wrong with that request. Please try again.