[BUG] 2.1.237 tagged `latest` with its linux-x64, win32-x64 and linux-x64-musl native packages never published - installs land on a dead 500-byte stub

Status Open
Reported on v2.1.237
Maintainer reply None cached
Activity 8 comments · opened Aug 20, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

@anthropic-ai/claude-code@2.1.237 is published and tagged latest, but three of its eight platform-native optionalDependencies were never published to the registry:

| native package | 2.1.237 published? | its own latest |
|---|---|---|
| @anthropic-ai/claude-code-linux-x64 | ❌ no | 2.1.236 |
| @anthropic-ai/claude-code-win32-x64 | ❌ no | 2.1.236 |
| @anthropic-ai/claude-code-linux-x64-musl | ❌ no | 2.1.236 |
| @anthropic-ai/claude-code-darwin-x64 | ✅ yes | 2.1.237 |
| @anthropic-ai/claude-code-darwin-arm64 | ✅ yes | 2.1.237 |
| @anthropic-ai/claude-code-linux-arm64 | ✅ yes | 2.1.237 |
| @anthropic-ai/claude-code-linux-arm64-musl | ✅ yes | 2.1.237 |
| @anthropic-ai/claude-code-win32-arm64 | ✅ yes | 2.1.237 |

The 2.1.237 package.json declares all eight at "2.1.237" exactly. npm resolves an absent optional dependency as "skip, no error", so the install exits 0, install.cjs finds nothing to copy, and bin/claude.exe is left as the 500-byte placeholder stub. The CLI is dead on arrival for Windows x64 and Linux x64 (glibc and musl) — i.e. most installs.

On Windows the symptom is actively misleading, because the stub is a sh script named .exe:

Program 'claude.exe' failed to run: An error occurred trying to start process
'...\node_modules\@anthropic-ai\claude-code\bin\claude.exe'
with working directory '...'. The specified executable is not a valid application
for this OS platform.

That reads as an architecture mismatch and sends you looking in the wrong place entirely.

This is not #84081 (blocked allowScripts), and the fix there does not apply here. I hit the allowScripts warning too and cleared it, and the install still produced the stub — because with --allow-scripts the postinstall does run, and then reports the package simply is not there:

[@anthropic-ai/claude-code postinstall] Native package "@anthropic-ai/claude-code-win32-x64" not found.
  This happens with --omit=optional or when the download failed.

No flags, no policy and no amount of retrying can fix this on the user side. The artifact does not exist.

Publish timestamps, for what they suggest about the release process:

claude-code           2.1.236  2026-08-19T18:45:14Z
claude-code-win32-x64 2.1.236  2026-08-19T19:24:23Z   <- native published ~39 min AFTER the main package
claude-code           2.1.237  2026-08-19T23:57:54Z
claude-code-win32-x64 2.1.237  absent (checked 2026-08-20T01:13Z, ~1h16m later)

For 2.1.236 the main package was also published before its natives, so there is an existing window where latest is unusable on every platform. 2.1.237 looks like the same window that never closed for three of the eight targets. If that ordering is intended, the window is the bug; if the three builds failed in CI, the release should not have been tagged latest regardless.

What Should Happen?

Short term — either publish the three missing native packages, or move the latest dist-tag back to 2.1.236 until they exist. Right now npm i -g @anthropic-ai/claude-code hands a Windows x64 or Linux x64 user a broken install with a success exit code.

Longer term:

  1. Publish natives before the package that depends on them, and tag latest only once every declared optionalDependency resolves. The 39-minute gap on 2.1.236 shows the ordering is currently the other way round.
  2. Fail the install loudly when the platform-native package is absent. Exiting 0 with a non-functional binary is the shared root cause of this issue, #84081, #84051 and #85154 — four different routes into the identical dead 500-byte stub. install.cjs already detects the condition and prints it; it should exit non-zero.
  3. A release gate that verifies all eight optional deps resolve at the published version before the dist-tag moves would have caught this one before any user did.

Error Messages/Logs

Registry state, reproducible right now:

$ npm view @anthropic-ai/claude-code@2.1.237 optionalDependencies
{
  '@anthropic-ai/claude-code-linux-x64': '2.1.237',
  '@anthropic-ai/claude-code-win32-x64': '2.1.237',
  ...
}

$ npm view @anthropic-ai/claude-code-win32-x64@2.1.237 version
npm error code E404
npm error 404 No match found for version 2.1.237
npm error 404  The requested resource '@anthropic-ai/claude-code-win32-x64@2.1.237'
npm error 404  could not be found or you do not have permission to access it.

$ npm view @anthropic-ai/claude-code-win32-x64 dist-tags
{ stable: '2.1.228', next: '2.1.236', latest: '2.1.236' }

$ npm view @anthropic-ai/claude-code dist-tags
{ stable: '2.1.228', latest: '2.1.237', next: '2.1.237' }

Resulting install:

$ npm i -g @anthropic-ai/claude-code
changed 1 package in 663ms

$ ls -l node_modules/@anthropic-ai/claude-code/bin/claude.exe
500 bytes          # healthy binary on this platform is 330,097,824 bytes

Contents of that 500-byte claude.exe:

echo "Error: claude native binary not installed." >&2
echo "Either postinstall did not run (--ignore-scripts, some pnpm configs)" >&2
echo "or the platform-native optional dependency was not downloaded" >&2

Steps to Reproduce

  1. On Windows x64 (or Linux x64), run npm i -g @anthropic-ai/claude-code
  2. Install exits 0
  3. Run claude — fails with the OS-platform error above
  4. Run npm i -g --allow-scripts=@anthropic-ai/claude-code @anthropic-ai/claude-code to rule out #84081. Still 500 bytes.
  5. Run node node_modules/@anthropic-ai/claude-code/install.cjs manually. It reports the native package is not found.
  6. npm view @anthropic-ai/claude-code-win32-x64@2.1.237 version → E404. It was never published.

Workaround for users: pin to the last version whose natives exist.

npm i -g @anthropic-ai/claude-code@2.1.236     # verified working, 330 MB binary
npm i -g @anthropic-ai/claude-code@stable      # 2.1.228, also fine

Note for anyone repairing this with live sessions open: on Windows the running claude.exe cannot be deleted, but npm renames the old tree to node_modules/@anthropic-ai/.claude-code-<random>/ and the running sessions keep working from there. The reinstall is safe with sessions open; it just leaves that ~326 MB directory behind with an EPERM cleanup warning until they exit.

Is this a regression?

Yes, against 2.1.236, whose win32-x64 native is published and installs correctly.

Version

Broken: 2.1.237. Working: 2.1.236.

  • Windows 11 Pro, 10.0.26200, x64
  • node v26.4.0, npm 11.17.0
  • npm global prefix outside Program Files

Related: #84081 (blocked allowScripts), #84051 (interrupted update), #85154 (stub + missing symlink), #88091 (concurrent-session update race) — all four land on the same 500-byte stub by a different route, which is the argument for fixing the exit code in install.cjs.

View original on GitHub ↗

7 Comments

dsent · 11 days ago

Yep, 2.1.237 broke claude for me under WSL2/Arch as well.

vizi0uz · 11 days ago

Following up with something that makes this worse than a one-off bad install: the background auto-updater reinstalls the broken version on its own, so repairing it does not stick.

Timeline on my machine (Windows 11 x64, npm-global under a conda prefix):

22:09:44   repaired by hand: npm i -g @anthropic-ai/claude-code@2.1.236
           bin\claude.exe = 330,097,824 bytes, claude --version -> 2.1.236   OK
22:19:28   auto-updater pulls 2.1.237 unprompted
           bin\claude.exe = 500 bytes, package.json -> 2.1.237               DEAD AGAIN

Ten minutes. No user action in between. So for anyone on win32-x64, linux-x64 or linux-x64-musl right now, this is not "install latest and get a broken CLI once" — it is a loop. You repair it, and the updater walks it back into the stub on its next check. Pinning to 2.1.236 is not sufficient on its own, because nothing in the install expresses the pin to the updater.

Workaround, for anyone hitting this before it is fixed upstream

Set the kill switch first, then repair — otherwise the repair is on a timer:

// ~/.claude/settings.json
{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}
npm i -g --allow-scripts=@anthropic-ai/claude-code @anthropic-ai/claude-code@2.1.236

I verified the variable is actually read by the binary before trusting it — findstr /M /C:"DISABLE_AUTOUPDATER" against the 326 MB claude.exe hits, as do autoUpdates and autoUpdaterStatus. Setting a variable the binary ignores would look exactly like a working fix until the next update landed.

⚠️ It applies per session, at startup. Sessions already running when you set it keep their own updater and can still re-break the install. Restart every live session, or the loop continues from the old ones. I had four alive and this cost me a second repair.

Remove the variable once the missing native packages are published.

Two things from the repair that may be useful for the fix itself

1. install.cjs can exit 0 having produced a version-mismatched install. After one retry it left me with package.json reporting 2.1.237 while claude --version reported 2.1.236. The native package was not in the tree at all; install.cjs had fallen back to the local bin\claude.exe.old.<timestamp> left by the previous update's rename. The CLI runs, so nothing looks wrong, but the wrapper and the binary disagree about what is installed. A clean reinstall of 2.1.236 brought both into line. This is a second silent-success path in the same script, alongside the missing-native one — checking --version alone does not detect it.

2. EBUSY on placing the binary can be transient. One attempt died with EBUSY: resource busy or locked, unlink 'bin\claude.exe'. A lock probe seconds later returned free, and no process was executing that path — the live sessions run the renamed copy, not the stub. A retry succeeded on the first try. Worth a short retry loop in install.cjs rather than surfacing it as a hard failure, since on Windows this is most likely a scanner or the just-finished write rather than a real holder.

Both of these reinforce the original ask: install.cjs exiting non-zero when it cannot place the correct binary would turn all of these into a loud failure instead of a working-looking install.

136397089 · 11 days ago

The workaround (npm i -g @anthropic-ai/claude-code@2.1.236) works, but most users hitting this won't know to look for it — they'll just conclude Claude Code is broken on their platform.

w0wl0lxd · 11 days ago

confirmed on NixOS (glibc x86_64) with mise/aube as npm backend.

aube add --global @anthropic-ai/claude-code@2.1.237 fails because @anthropic-ai/claude-code-linux-x64@2.1.237 does not resolve. npm with --omit=optional installs but leaves the 500-byte stub, so claude is non-functional.

of the eight optionalDependencies declared at 2.1.237, only these four exist (as issue author stated):

  • @anthropic-ai/claude-code-darwin-x64 2.1.237
  • @anthropic-ai/claude-code-darwin-arm64 2.1.237
  • @anthropic-ai/claude-code-linux-arm64 2.1.237
  • @anthropic-ai/claude-code-win32-arm64 2.1.237

these three are 404:

  • @anthropic-ai/claude-code-linux-x64 2.1.237
  • @anthropic-ai/claude-code-linux-x64-musl 2.1.237
  • @anthropic-ai/claude-code-win32-x64 2.1.237

as my (and 95% of the world) machine(s) needs linux-x64, which is missing, claude errors/freezes, was only easy to debug due to experience with mise/nix/aube/npm. pinning to 2.1.236 works as stated

lwy521 · 11 days ago

Same issue on Windows 11 Enterprise 26200 x64, node v26.5.0. Auto-updated from 2.1.236 to 2.1.237. Confirmed win32-x64 native is E404 on registry. Workaround npm i -g @anthropic-ai/claude-code@2.1.236 fixed it. Please publish the missing native or move latest back to 236.

momiji-comici · 11 days ago

Linux x64 data point, and a correction to the "safe with sessions open" note.

1. The downgrade does not hold on npm-global Linux installs.

npm i -g @anthropic-ai/claude-code@2.1.236 restores a working CLI, but the background updater re-applies 2.1.237 on the next launch and the install returns to the stub. Repaired it twice, broke twice. The workaround needs DISABLE_AUTOUPDATER=1 in ~/.claude/settings.json (or autoUpdatesChannel: "stable") set before the reinstall, otherwise the pin is silently undone.

2. On Linux, the in-place update is not safe with sessions open.

The note about npm renaming the old tree so running sessions keep working did not hold here. The update was applied mid-run to a background session, after which the background service could no longer be spawned:

Couldn't reach the background service (spawn background service: ENOEXEC:
unknown error, posix_spawn '<npm-global-prefix>/lib/node_modules/@an...')

The session still appeared in claude agents but selecting it did nothing — it was unreachable. Roughly three hours of work was lost. The workflow ran under a custom skill that only produces usable output on completion, so the partial artifacts on disk were worthless.

That makes this more than a broken install: on the latest channel the updater will keep pulling 2.1.237 into working installations and killing whatever is running at the time. Possibly overlapping with #88091.

Note this is npm 10.9.8 / node 22, a different generation from the report above (npm 11 / node 26) — the missing artifact breaks the install regardless of npm version, as expected for a package that simply is not on the registry.

Env: Ubuntu 26.04 LTS, Linux x64, node v22.23.1, npm 10.9.8, npm global prefix under $HOME, auto-updated from 2.1.235.

hueidou · 11 days ago

+1. Confirming this on Windows 11 x64. My auto-update ran this morning and the same thing happened. Here's the full evidence chain from my machine, in case it helps:

Environment

  • OS: Windows 11 Pro 22H2, x64
  • Install: npm global (npm i -g @anthropic-ai/claude-code)
  • Auto-updated from 2.1.236 → 2.1.237 on 2026-08-20T01:58:27Z (UTC)

Symptom

After the auto-update, claude in a fresh terminal fails immediately:

> claude --version
"The specified program is not a valid Win32 application" (exit code 1)

bin/claude.exe in the global install is a 500-byte placeholder stub (the echo "Error: claude native binary not installed..." script), not a real PE binary. The platform package @anthropic-ai/claude-code-win32-x64 is absent from node_modules/@anthropic-ai/.

The only session still alive is the one that was launched 14 seconds before the update finished (PID started 01:58:13Z, update completed 01:58:27Z) — its 2.1.236 binary is memory-mapped, so it keeps running. Any new session cannot be started at all until this is fixed.

Showing cached comments. Read the full discussion on GitHub ↗