[Bug] `claude update` detects false positive npm installation in native binary directory

Resolved 💬 3 comments Opened Mar 18, 2026 by chanwutk Closed Mar 18, 2026

Bug Description
claude update mistakes itself for an npm-installed version.

When I run claude update, I received this out put with a warning.

Current version: 2.1.78
Checking for updates to latest version...

Warning: Multiple installations found
- npm-global at /Users/chanwutk/.local/bin/claude
- native at /Users/chanwutk/.local/bin/claude (currently running)

Warning: Leftover npm global installation at /Users/chanwutk/.local/bin/claude
Fix: Run: npm -g uninstall @anthropic-ai/claude-code
Claude Code is up to date (2.1.78).

However, I do not have the npm version of claude installed any more. I suspected that the npm-installed version was at the same directory as claude's binary version.

I asked claude code to confirm my suspicion. Here is the answer, which I agree:

  Found it. Here's what's happening:

  The root cause: Your npm global prefix is set to ~/.local, which makes npm's global bin directory ~/.local/bin/ — the same directory where Claude Code's native installer puts its binary.

  - Native install: ~/.local/bin/claude → symlink to ~/.local/share/claude/versions/2.1.78
  - npm global bin: also ~/.local/bin/

  So Claude Code's detection logic sees ~/.local/bin/claude exists in npm's global bin path and concludes there's an npm-global installation, even though npm list -g @anthropic-ai/claude-code shows the package is already uninstalled (empty).

  Why uninstalling didn't help: npm -g uninstall @anthropic-ai/claude-code removed the package from ~/.local/lib/node_modules/ (confirmed empty), but the symlink at ~/.local/bin/claude is the native installation's symlink — not npm's. npm didn't create it, so it didn't remove it. Claude Code's update checker still
  finds a claude binary in npm's global bin dir and flags it as a leftover npm installation.

  In short: the warning is a false positive caused by the native install path overlapping with the npm global bin path.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.78
  • Feedback ID: 75a53663-8a3f-48c0-9888-949642007ada

View original on GitHub ↗

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