[BUG] Binary loads `bin/claude.exe`
Status Open
Reported on v2.1.218
Maintainer reply None cached
Activity 0 comments · opened Jul 24, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Current @anthropic-ai/claude-code version (2.1.218) have the following line:
"bin": {
"claude": "bin/claude.exe"
},
It tries to load the exe binary on every platform, which doesn't work on Linux and macOS.
What Should Happen?
If the following comment is true:
// Detects the platform, finds the matching native binary from optionalDependencies,
// and copies it over the bin/claude.exe placeholder. After this runs, `claude` execs
// the native binary directly — no Node.js process stays resident.
Then these platforms:
const PLATFORMS = {
'darwin-arm64': { pkg: PACKAGE_PREFIX + '-darwin-arm64', bin: BINARY_NAME },
'darwin-x64': { pkg: PACKAGE_PREFIX + '-darwin-x64', bin: BINARY_NAME },
'linux-x64': { pkg: PACKAGE_PREFIX + '-linux-x64', bin: BINARY_NAME },
'linux-arm64': { pkg: PACKAGE_PREFIX + '-linux-arm64', bin: BINARY_NAME },
'linux-x64-musl': {
pkg: PACKAGE_PREFIX + '-linux-x64-musl',
bin: BINARY_NAME,
},
'linux-arm64-musl': {
pkg: PACKAGE_PREFIX + '-linux-arm64-musl',
bin: BINARY_NAME,
},
'linux-arm64-android': {
pkg: PACKAGE_PREFIX + '-linux-arm64-android',
bin: BINARY_NAME,
},
'linux-x64-android': {
pkg: PACKAGE_PREFIX + '-linux-x64-android',
bin: BINARY_NAME,
},
'win32-x64': {
pkg: PACKAGE_PREFIX + '-win32-x64',
bin: BINARY_NAME + '.exe',
},
'win32-arm64': {
pkg: PACKAGE_PREFIX + '-win32-arm64',
bin: BINARY_NAME + '.exe',
},
}
Should all have + '.exe'.
Error Messages/Logs
node:internal/modules/esm/get_format:243
throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".exe" for /var/home/nexus/.cache/aube/virtual-store/@anthropic-ai+claude-code@2.1.218-86cc59cf7d6347bb/node_modules/@anthropic-ai/claude-code/bin/claude.exe
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:243:9)
at defaultGetFormat (node:internal/modules/esm/get_format:283:36)
at defaultLoadSync (node:internal/modules/esm/load:161:16)
at #loadAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:809:12)
at #loadSync (node:internal/modules/esm/loader:841:53)
at ModuleLoader.load (node:internal/modules/esm/loader:790:26)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:501:31)
at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:567:36)
at afterResolve (node:internal/modules/esm/loader:614:52)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:620:12) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Node.js v26.5.0
Steps to Reproduce
npm install -g @anthropic-ai/claude-code
claude
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.112
Claude Code Version
2.1.206
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Non-interactive/CI environment
Additional Information
Relevant issue that was ignored: