From 5fce278a688a1cb79183e012bde40b089c2e97a4 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Sun, 4 Jan 2015 13:12:16 +0000 Subject: 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 --- lib/utils/lifecycle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 } -- cgit v1.2.3