Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEd Morley <emorley@mozilla.com>2015-01-04 16:12:16 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-01-16 09:15:05 +0300
commit5fce278a688a1cb79183e012bde40b089c2e97a4 (patch)
treec04426d8a3050d4e69cdf31a91ae694ee8e48aad /lib
parent98e1e1080df1f2cab16ed68035603950ea3d2d48 (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')
-rw-r--r--lib/utils/lifecycle.js2
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
}