[Bug] Auto-updater EEXIST error leaves npm global symlink broken

Resolved 💬 3 comments Opened Dec 12, 2025 by ScotterC Closed Dec 16, 2025

FWIW The below is completely composed by Claude after some investigation.

Bug Description
Auto-updater leaves installation broken due to EEXIST error on symlink
Environment:

Platform: macOS
Installation: npm global via mise-managed node 23.7.0
Version: (run claude --version to get current)

Bug Description:
The auto-updater's uninstall-then-reinstall approach can leave installations in a broken state. The updater successfully removes the package contents but fails to reinstall due to an EEXIST error on the existing symlink.
Debug Logs:
2025-12-12T19:35:13.889Z [DEBUG] AutoUpdater: Detected installation type: npm-global
2025-12-12T19:35:13.889Z [DEBUG] AutoUpdater: Using global update method
2025-12-12T19:35:15.181Z [ERROR] _nA: _nA: Failed to install new version of claude:
npm error code EEXIST
npm error EEXIST: file already exists, symlink '...cli.js' -> '.../bin/claude'
Result:

@anthropic-ai/claude-code directory emptied
bin symlink still exists but points to nothing
which claude returns nothing in new shells
Running sessions survive (code loaded in memory)

Historical Pattern:
This has occurred multiple times:
2025-12-11T06:54:19.510Z [ERROR] Failed to install new version of claude: EEXIST
Suggested Fix:

Use npm install -g --force to handle existing symlinks
Or: implement atomic update (install new before removing old)
Or: clean up symlink before reinstall attempt

Workaround:
npm install -g @anthropic-ai/claude-code (manual reinstall)

Environment Info

  • Platform: darwin
  • Terminal: WarpTerminal
  • Version: 2.0.67
  • Feedback ID: 27098442-b9cf-484e-be37-4acdc3afc573

Errors

[]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗