From 3e4b9c07d28c5a5347d297fe4da669a0b0fa4d5c Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 26 Feb 2019 14:01:03 -0800 Subject: [PATCH] Revert "Do not wrap npm path with quotes" This reverts commit 1ed5e1c63b71e0a4e7fd0493a37e43a7ef518ebb. --- src/typingsInstaller/nodeTypingsInstaller.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/typingsInstaller/nodeTypingsInstaller.ts b/src/typingsInstaller/nodeTypingsInstaller.ts index 2facb1223d0..1d75218c883 100644 --- a/src/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/typingsInstaller/nodeTypingsInstaller.ts @@ -89,6 +89,10 @@ namespace ts.server.typingsInstaller { log); this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0]); + // If the NPM path contains spaces and isn't wrapped in quotes, do so. + if (stringContains(this.npmPath, " ") && this.npmPath[0] !== `"`) { + this.npmPath = `"${this.npmPath}"`; + } if (this.log.isEnabled()) { this.log.writeLine(`Process id: ${process.pid}`); this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${Arguments.NpmLocation}' ${npmLocation === undefined ? "not " : ""} provided)`);