anthropics / anthropics/claude-code
[Bug] Silent npm global install failure with stale staging directory leaves corrupted binary
- Langage dominant
- Python
- Étoiles
- 145k
- Forks
- 23.1k
- Métriques de merge des PR
- Métriques de PR en attente
Description
**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
[]
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- bun, linux, node.js
- Domaine
- cli, operating-systems, release
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100