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. diff --git a/packages/compiler/src/core/install.ts b/packages/compiler/src/core/install.ts index 43dd076305..428769dc70 100644 --- a/packages/compiler/src/core/install.ts +++ b/packages/compiler/src/core/install.ts @@ -13,8 +13,8 @@ export async function installTypeSpecDependencies( host: CliCompilerHost, directory: string ): Promise { - const cmd = process.platform === "win32" ? "npm.cmd" : "npm"; - const child = spawn(cmd, ["install"], { + const child = spawn("npm", ["install"], { + shell: process.platform === "win32", stdio: "inherit", cwd: directory, env: process.env,