From 823565e95102343449bc687387d43a5f223390b1 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Wed, 28 Aug 2024 09:13:36 -0300 Subject: [PATCH] fix: don't quote executable in windows --- lib/base-package-manager.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/base-package-manager.ts b/lib/base-package-manager.ts index 86e40c8ea9..12b24df7d1 100644 --- a/lib/base-package-manager.ts +++ b/lib/base-package-manager.ts @@ -1,4 +1,4 @@ -import { isInteractive, quoteString } from "./common/helpers"; +import { isInteractive } from "./common/helpers"; import { INodePackageManager, INodePackageManagerInstallOptions, @@ -108,19 +108,11 @@ export abstract class BasePackageManager implements INodePackageManager { ): Promise { const npmExecutable = this.getPackageManagerExecutableName(); const stdioValue = isInteractive() ? "inherit" : "pipe"; - const sanitizedNpmExecutable = this.$hostInfo.isWindows - ? quoteString(npmExecutable) - : npmExecutable; - await this.$childProcess.spawnFromEvent( - sanitizedNpmExecutable, - params, - "close", - { - cwd: opts.cwd, - stdio: stdioValue, - shell: this.$hostInfo.isWindows, - } - ); + await this.$childProcess.spawnFromEvent(npmExecutable, params, "close", { + cwd: opts.cwd, + stdio: stdioValue, + shell: this.$hostInfo.isWindows, + }); // Whenever calling "npm install" or "yarn add" without any arguments (hence installing all dependencies) no output is emitted on stdout // Luckily, whenever you call "npm install" or "yarn add" to install all dependencies chances are you won't need the name/version of the package you're installing because there is none.