anthropics / anthropics/claude-code

[Bug] Silent npm global install failure with stale staging directory leaves corrupted binary

Offen
#92,526 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:installation area:packaging bug platform:linux
Vorherrschende Sprache
Python
Sterne
145k
Forks
23.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

**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**
```json
[]
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with install.cjs and the global npm update path, then inspect how the staging directory, native binary, and .last-update-result.json are handled. Reproduce the stale .claude-code-* scenario on Linux and verify that a failed or truncated update cannot be recorded as successful, leave an unusable binary, or suppress the error.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
bun, linux, node.js
Bereich
cli, operating-systems, release
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.