claude update misdetects native install as npm-global, replaces it
Resolved 💬 3 comments Opened Feb 25, 2026 by 0x91 Closed Mar 1, 2026
Summary
claude update run from a native binary misdetects the installation type as npm-global, deletes the native symlink at ~/.local/bin/claude, and replaces it with an npm global install.
Environment
- macOS (Darwin 25.3.0, arm64)
- Native binary installed via
claude installat~/.local/bin/claude -> ~/.local/share/claude/versions/2.1.52 - nvm installed with node v22.17.0
~/.claude.jsonhasinstallMethod: "native",autoUpdates: false
Steps to reproduce
- Install claude natively via
claude install(symlink at~/.local/bin/claude) - Have nvm on PATH (no npm global
@anthropic-ai/claude-codeinstalled) - Run
claude update
What happens
Debug log from the session:
update: Installation type: npm-global
update: Config install method: global
Removed claude symlink at /Users/charlie/.local/bin/claude
update: Checking npm registry for latest version
update: Update method determined: global
update: Calling installGlobalPackage() for global update
update: Installation status: success
The update command:
- Detects the native binary as
npm-global(incorrect) - Deletes the
~/.local/bin/claudesymlink - Runs
npm install --global @anthropic-ai/claude-code - Overwrites
installMethodto"global"in~/.claude.json
Secondary issue: self-perpetuating cycle
Once the npm package is installed and nvm's bin directory is higher on PATH than ~/.local/bin, every subsequent session:
- Runs the npm version (nvm wins the PATH race)
- Mismatch detection resets
installMethodto"global" - The background auto-updater (if enabled) keeps the npm package updated
- Uninstalling the npm package doesn't help — the auto-updater in existing sessions reinstalls it
The native binary is effectively unreachable until the npm package is manually removed AND all existing sessions are killed.
Expected behavior
claude update should correctly detect it's running from a native binary and use the native update path. It should never delete the native symlink or fall through to npm installation.
Workaround
npm uninstall -g @anthropic-ai/claude-code- Ensure
~/.local/bincomes before nvm on PATH - Set
installMethod: "native"in~/.claude.json - Kill any existing sessions (their in-memory auto-updater can reinstall the npm package)
- Don't run
claude update— the native auto-updater handles updates without this bug
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗