fix: resolve native .exe target in Claude Code npm shim on Windows - #25
Open
tjoker911 wants to merge 1 commit into
Open
fix: resolve native .exe target in Claude Code npm shim on Windows#25tjoker911 wants to merge 1 commit into
tjoker911 wants to merge 1 commit into
Conversation
Newer @anthropic-ai/claude-code npm installs ship a bundled claude.exe instead of a cli.js entry point, but the daemon's .cmd shim resolver only matched .js targets. It fell through to spawning the .cmd shim directly, which Windows rejects with EINVAL. Now resolves .exe targets and spawns them directly instead of routing through node.exe. Also commit pnpm's approved-builds config so future installs don't need to re-approve esbuild/sharp/unrs-resolver postinstall scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@anthropic-ai/claude-codenpm installs ship a bundled nativeclaude.exebinary instead of acli.jsentry point..cmdshim resolver (scripts/daemon/runner.ts) only matched.jstargets, so on affected installs it fell through and tried to spawn the.cmdshim directly.child_process.spawn()on Windows rejects spawning.cmdfiles directly withshell: false, throwingspawn EINVAL. Every task launch (Launch button, daemon, continuous missions) failed immediately with this error..exetargets from the shim as well, spawning the native binary directly instead of routing throughnode.exe.Test plan
pnpm tsc --noEmitpassespnpm test— all 193 tests passEINVALfailure on Windows with a current global npm install of Claude Code (shim pointing atbin/claude.exe).execorrectly, verified via a real task run through/api/tasks/[id]/run🤖 Generated with Claude Code