From 59667f9a57ffc280ef8e2d8fc147c840cdd2ff0d Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Tue, 17 Mar 2026 18:07:19 +0200 Subject: [PATCH] fix(cli): use .cmd shim for local tsc on Windows --- packages/opencode/src/kilocode/ts-check.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/kilocode/ts-check.ts b/packages/opencode/src/kilocode/ts-check.ts index f4627454826..449609df830 100644 --- a/packages/opencode/src/kilocode/ts-check.ts +++ b/packages/opencode/src/kilocode/ts-check.ts @@ -107,11 +107,13 @@ export namespace TsCheck { return undefined } - // Walk up from root looking for node_modules/typescript/bin/tsc + // Walk up from root looking for a usable tsc binary. + // On Windows the JS entrypoint has no shebang support, so use the .cmd shim. async function local_tsc(root: string): Promise { + const shim = process.platform === "win32" ? path.join(".bin", "tsc.cmd") : path.join("typescript", "bin", "tsc") let dir = root while (true) { - const bin = path.join(dir, "node_modules", "typescript", "bin", "tsc") + const bin = path.join(dir, "node_modules", shim) if (await exists(bin)) return bin const parent = path.dirname(dir) if (parent === dir) break