Repository navigation
fix(runtime): run the native binary of an npm install of Claude Code - #126
Merged
Merged
Conversation
The npm package (seen with 2.1.287) ships the native claude.exe under node_modules/@anthropic-ai/claude-code/bin, and its claude.cmd/.ps1 only call it. The daemon refused the launcher and stopped there, so owners who installed Claude Code with npm saw it as missing. - a claude.cmd/.ps1 resolves to that binary, unless it is still the small placeholder the npm postinstall replaces - a launcher that cannot run no longer stops the search; later PATH entries are still tried - on Windows, also look in %USERPROFILE%\.local\bin, WinGet Links and %APPDATA%\npm, for a PATH set only in a shell profile The lookup moves to runtime/claude/locate.rs to keep claude.rs short. Spec 7.4 and section 19 updated.
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.
Why
A Windows user installed Claude Code with npm, signed in, and could run
claudein PowerShell, but Botloft said Claude Code was missing. The daemon found%APPDATA%\npm\claude.cmd, refused it as the npm launcher and stopped searching.The npm package (seen with 2.1.287) already ships the native binary at
node_modules\@anthropic-ai\claude-code\bin\claude.exe;claude.cmdandclaude.ps1only call it. Pointingclaude_pathat that file fixed it for the user.What
claude.cmd/.ps1(on PATH or inclaude_path) resolves to the native binary next to it. If that file is still the ~500-byte placeholder the npm postinstall replaces (--omit=optional,--ignore-scripts), the launcher is refused as before.%USERPROFILE%\.local\bin(native installer),%LOCALAPPDATA%\Microsoft\WinGet\Linksand%APPDATA%\npm, for a PATH set only in a shell profile.runtime/claude/locate.rssoclaude.rsstays short.Tests
claude.exe, Windows usual place found off PATH.cargo fmt --check,clippy -D warningsandcargo test --workspacepass locally.Manual check (real Claude Code)
npm i -g @anthropic-ai/claude-codeand an emptyclaude_path, Botloft finds Claude Code and shows the signed-in account.