diff --git a/lib/package-managers/base-package-manager.js b/lib/package-managers/base-package-manager.js index f7a938f0..48b749b1 100644 --- a/lib/package-managers/base-package-manager.js +++ b/lib/package-managers/base-package-manager.js @@ -11,14 +11,17 @@ exports.BasePackageManager = class { } run(command, args = [], workingDirectory = process.cwd()) { + const isWindows = process.platform === "win32"; + let executable = this.getExecutablePath(workingDirectory); let options = { stdio: "inherit", cwd: workingDirectory }; - if (process.platform === "win32") { + if (isWindows) { + executable = `"${executable}"` options = { ...options, shell: true } } return new Promise((resolve, reject) => { this.proc = spawn( - this.getExecutablePath(workingDirectory), + executable, [command, ...args], options )