Permalink
Browse files

node exe dir to the PATH for lifestyle scripts

Fixes #2680.
  • Loading branch information...
1 parent 4c41a75 commit 898594413b0ca3d4bf120dfffeb493dae516b4e9 @TooTallNate TooTallNate committed with isaacs Aug 7, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/utils/lifecycle.js
View
@@ -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 8985944

Please sign in to comment.