Skip to content

Commit

Permalink
Add shell: true to TSP install command. (#3243)
Browse files Browse the repository at this point in the history
This is a breakage due to a breaking change in node's latest incremental
version. (See nodejs/node#52554 for
background). Adding shell: true fixes this.

Fixes #3242.

---------

Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
  • Loading branch information
LadyCailin and timotheeguerin authored Apr 26, 2024
1 parent df4dac2 commit 713e22d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .chronus/changes/main-2024-3-26-15-49-18.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions packages/compiler/src/core/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export async function installTypeSpecDependencies(
host: CliCompilerHost,
directory: string
): Promise<void> {
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,
Expand Down

0 comments on commit 713e22d

Please sign in to comment.