[Bug] Silent npm global install failure with stale staging directory leaves corrupted binary
Bug Description
npm global install on Linux. A stale .claude-code-* staging dir from an earlier aborted update caused the usual ENOTEMPTY loop (#17095, #12533, etc.) — but in my case it failed silently and destructively rather than showing the usual ✗ Auto-update failed. The attempt created all 8 platform dirs, left 7 empty, extracted a truncated linux-x64 binary (168,051,825 bytes) with no package.json, left the 500-byte stub in bin/claude.exe, and never renamed bin/.claude-7wW5Kp7d to bin/claude. .last-update-result.json recorded "outcome":"success". Net effect: claude: command not found with zero error output, while npm ls -g still reported the package installed at 2.1.263. Manually running install.cjs reported "Native package not found — this happens with --omit=optional or when the download failed," neither of which applied; it failed only because require.resolve couldn't find the missing manifest. After hand-writing that manifest, the linked binary crashed with a Bun bus error, suggesting truncation.
Environment Info
- Platform: linux
- Terminal: tmux
- Version: 2.1.263
- Feedback ID: 39209c63-9c67-4333-952b-778335e18815
Errors
[]