Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Quote paths passed to child_process.exec.

This is necessary on Windows; otherwise you get

    2> 'c:\PROGRAM' is not recognized as an internal or external command,
    2> operable program or batch file.

since Node/npm are in "C:\Program Files (x86)\nodejs", which has spaces in it.
  • Loading branch information...
commit 391b8a3239710efaa9089dab8d5e2b2f25e19b6b 1 parent 59dda0b
@domenic domenic authored isaacs committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 test/run.js
View
4 test/run.js
@@ -72,8 +72,8 @@ function exec (cmd, shouldFail, cb) {
// special: replace 'node' with the current execPath,
// and 'npm' with the thing we installed.
var cmdShow = cmd
- cmd = cmd.replace(/^npm /, path.resolve(npmPath, "npm") + " ")
- cmd = cmd.replace(/^node /, process.execPath + " ")
+ cmd = cmd.replace(/^npm /, "\"" + path.resolve(npmPath, "npm") + "\" ")
+ cmd = cmd.replace(/^node /, "\"" + process.execPath + "\" ")
child_process.exec(cmd, {env: env}, function (er, stdout, stderr) {
if (stdout) {
Please sign in to comment.
Something went wrong with that request. Please try again.