Skip to content

fix(install): resolve binaries with Bun.which so Windows stops reporting bun, git and claude missing - #2297

Open
Simonvm9114 wants to merge 1 commit into
danielmiessler:mainfrom
Simonvm9114:fix/windows-binary-lookup
Open

Simonvm9114 wants to merge 1 commit into
danielmiessler:mainfrom
Simonvm9114:fix/windows-binary-lookup

Conversation

@Simonvm9114

Copy link
Copy Markdown

Fixes #2295.

On native Windows, DetectEnv reported bun, git and the harness binary as missing, and ClipSource died on a missing which with ffmpeg installed. Both looked binaries up the POSIX way:

  • detectTool() and detectHarness() ran command -v through execSync, which uses cmd.exe on win32. cmd.exe has no command built-in, so every probe failed, including inside Claude Code's Bash tool and hooks.
  • ClipSource.requireBinary() spawned which, which does not exist on Windows outside Git Bash.

Change

  • Tools/InstallEngine.ts (and its shipped copy in install/skills/LifeOS/Tools/): a small findBin() resolves with Bun.which, which is cross-platform and PATHEXT-aware (it finds npm's claude.cmd). The file only uses Node built-ins elsewhere, so outside bun it falls back to where on win32 and command -v on POSIX. detectTool() and hasBin call it; version probes are unchanged.
  • install/LIFEOS/TOOLS/ClipSource.ts: requireBinary() uses Bun.which.

macOS and Linux take the same Bun.which path. That is a behaviour change there only in mechanism, not in result; I have not run it on those platforms.

Verification (Windows 11 Pro 10.0.26200, bun 1.4.2, Git for Windows 2.52.0, Claude Code 2.1.291 via npm, ffmpeg 8.0.1)

Before After
bun Tools/DetectEnv.ts from PowerShell bun/git installed: false, harness assumed installed: true with versions and paths, harness detected
Same from Git Bash same as above same as above (fixed)
ClipSource.ts <dummy> --start 0 --end 5 from PowerShell Executable not found in $PATH: "which" passes the ffmpeg/ffprobe checks, stops at source file not found
detectTool("git", ...) under Node (no Bun global) n/a resolves git.exe via where

Out of scope, noted in the issue: skills/Webdesign/Tools/VerifyDesign.ts:33 and DriveClaudeDesign.ts:18 use the same spawned which, but outside Git Bash VerifyDesign fails earlier on a spawned mkdir -p, so they need a broader look than this fix.

🤖 Generated with Claude Code

…lmiessler#2295)

On native Windows, DetectEnv reported bun, git and the harness binary as
missing: detectTool() and detectHarness() ran `command -v` through
execSync, which uses cmd.exe on win32, and cmd.exe has no `command`
built-in. This happened even inside Claude Code's Bash tool and hooks.
ClipSource's requireBinary() spawned `which`, which does not exist on
Windows outside Git Bash, so it died on ENOENT with ffmpeg installed.

- InstallEngine.ts (both shipped copies): new findBin() uses Bun.which,
  which is cross-platform and PATHEXT-aware (finds npm's claude.cmd).
  Outside bun it falls back to `where` on win32, `command -v` elsewhere.
- ClipSource.ts: requireBinary() uses Bun.which.

Verified on Windows 11, bun 1.4.2, from PowerShell and from Git Bash:
DetectEnv now reports bun and git installed and the claude-code harness
as "detected"; ClipSource passes its ffmpeg/ffprobe checks and stops at
the (dummy) source file. The non-bun fallback resolves git via `where`
under Node. macOS/Linux take the same Bun.which path; not run there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant