diff options
author | Ed Morley <emorley@mozilla.com> | 2015-01-04 16:12:16 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-01-16 09:15:05 +0300 |
commit | 5fce278a688a1cb79183e012bde40b089c2e97a4 (patch) | |
tree | c04426d8a3050d4e69cdf31a91ae694ee8e48aad /lib/utils/lifecycle.js | |
parent | 98e1e1080df1f2cab16ed68035603950ea3d2d48 (diff) |
scripts: use full path for cmd.exe on Win32
Currently lifecycle.js assumes that Window's cmd.exe is on the PATH,
and fails with a spawn ENOENT error if it is not.
The Windows 'comspec' environment variable contains the full filepath
to the default command interpreter, eg "C:\Windows\System32\cmd.exe".
Should it not be set, we fall-back to using 'cmd' from PATH, as before.
Fixes https://github.com/npm/npm/issues/5267
Diffstat (limited to 'lib/utils/lifecycle.js')
-rw-r--r-- | lib/utils/lifecycle.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/lifecycle.js b/lib/utils/lifecycle.js index 12aff86d3..299fa5698 100644 --- a/lib/utils/lifecycle.js +++ b/lib/utils/lifecycle.js @@ -199,7 +199,7 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { var shFlag = "-c" if (process.platform === "win32") { - sh = "cmd" + sh = process.env.comspec || "cmd" shFlag = "/c" conf.windowsVerbatimArguments = true } |