From 23af14a32dacc2e984f8609aea5f79bf7bfaf38a Mon Sep 17 00:00:00 2001 From: ThanhNguyxn Date: Mon, 26 Jan 2026 19:21:57 +0700 Subject: [PATCH] fix(infra): use `where` on Windows for binary detection Fixes #2172 --- src/infra/binaries.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/infra/binaries.ts b/src/infra/binaries.ts index 492cf5a9c..3e82ee940 100644 --- a/src/infra/binaries.ts +++ b/src/infra/binaries.ts @@ -7,7 +7,9 @@ export async function ensureBinary( runtime: RuntimeEnv = defaultRuntime, ): Promise { // Abort early if a required CLI tool is missing. - await exec("which", [name]).catch(() => { + // Use `where` on Windows, `which` elsewhere. + const cmd = process.platform === "win32" ? "where" : "which"; + await exec(cmd, [name]).catch(() => { runtime.error(`Missing required binary: ${name}. Please install it.`); runtime.exit(1); });