Skip to content

Commit

Permalink
supported process.env.npm_execpath if process.env.npm_config_user_age…
Browse files Browse the repository at this point in the history
…nt is undefined
  • Loading branch information
shian15810 committed Jun 17, 2019
1 parent f091679 commit baf9afb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/by-node-env
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ var env = Object.assign(
);

var pm = whichPMRuns();
var command = pm ? pm.name : 'npm';
if (process.platform === 'win32') {
command += '.cmd';
}
var command =
pm && pm.name
? pm.name + (process.platform === 'win32' ? '.cmd' : '')
: process.env.npm_execpath || 'npm';

var script = [
env.npm_lifecycle_event, // e.g. "start"
Expand Down

0 comments on commit baf9afb

Please sign in to comment.