anthropics / anthropics/claude-code
[Bug] Silent npm global install failure with stale staging directory leaves corrupted binary
- 主要言語
- Python
- スター
- 145k
- フォーク
- 23.1k
- PR マージ指標
- PR 指標を取得中
説明
**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
[]
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- bun, linux, node.js
- 領域
- cli, operating-systems, release
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100