From 607c2d1f71be38aed889819111fa63b3da7b9c21 Mon Sep 17 00:00:00 2001 From: LadyCailin Date: Fri, 26 Apr 2024 15:23:31 +0200 Subject: [PATCH 1/3] Add shell: true to TSP install command. This is a breakage due to a breaking change in node's latest incremental version. (See https://github.com/nodejs/node/issues/52554 for background). Addint shell: true fixes this. Fixes #3242. --- packages/compiler/src/core/install.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/compiler/src/core/install.ts b/packages/compiler/src/core/install.ts index 43dd076305..e1761f85e2 100644 --- a/packages/compiler/src/core/install.ts +++ b/packages/compiler/src/core/install.ts @@ -15,6 +15,7 @@ export async function installTypeSpecDependencies( ): Promise { const cmd = process.platform === "win32" ? "npm.cmd" : "npm"; const child = spawn(cmd, ["install"], { + shell: true, stdio: "inherit", cwd: directory, env: process.env, From c05606721e8415e7700e69d626c0193ca28f850b Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Fri, 26 Apr 2024 08:46:36 -0700 Subject: [PATCH 2/3] Update packages/compiler/src/core/install.ts --- packages/compiler/src/core/install.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/compiler/src/core/install.ts b/packages/compiler/src/core/install.ts index e1761f85e2..428769dc70 100644 --- a/packages/compiler/src/core/install.ts +++ b/packages/compiler/src/core/install.ts @@ -13,9 +13,8 @@ export async function installTypeSpecDependencies( host: CliCompilerHost, directory: string ): Promise { - const cmd = process.platform === "win32" ? "npm.cmd" : "npm"; - const child = spawn(cmd, ["install"], { - shell: true, + const child = spawn("npm", ["install"], { + shell: process.platform === "win32", stdio: "inherit", cwd: directory, env: process.env, From e71fc8199f4f5f818d7167cb6fc2a2f0e55b08dd Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Fri, 26 Apr 2024 08:50:12 -0700 Subject: [PATCH 3/3] Create main-2024-3-26-15-49-18.md --- .chronus/changes/main-2024-3-26-15-49-18.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/main-2024-3-26-15-49-18.md diff --git a/.chronus/changes/main-2024-3-26-15-49-18.md b/.chronus/changes/main-2024-3-26-15-49-18.md new file mode 100644 index 0000000000..8292e442f0 --- /dev/null +++ b/.chronus/changes/main-2024-3-26-15-49-18.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - "@typespec/compiler" +--- + +Fix calling `tsp install` on windows due to recent NodeJS breaking change to fix vulnerability.