False positive "Multiple installations found" warning when npm prefix is set to ~/.local

Resolved 💬 3 comments Opened Mar 18, 2026 by myluckyterry Closed Mar 21, 2026

Description

When running claude update, a false warning about multiple installations is displayed, even though only the native installation exists.

Environment

  • OS: Debian 13 (trixie)
  • Claude Code version: 2.1.78
  • Installation method: Native (installed via official installer)
  • npm prefix: ~/.local (set in ~/.npmrc to avoid requiring sudo for global installs)

Steps to Reproduce

  1. Set npm global prefix to ~/.local in ~/.npmrc:

``
prefix=~/.local
``

  1. Install Claude Code using the native installer (not via npm)
  2. Run claude update

Actual Behavior

$ claude update
Current version: 2.1.78
Checking for updates to latest version...

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

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

However, there is no npm global installation of claude-code:

$ npm ls -g @anthropic-ai/claude-code
~/.local/lib
└── (empty)

$ which -a claude
~/.local/bin/claude

$ readlink -f ~/.local/bin/claude
~/.local/share/claude/versions/2.1.78

The binary at ~/.local/bin/claude is a symlink created by the native installer, pointing to ~/.local/share/claude/versions/2.1.78.

Expected Behavior

No warning should be shown, since there is only one installation (native).

Root Cause Analysis

The update checker appears to detect installations by checking if a claude binary exists at the npm global bin path ($(npm prefix -g)/bin/). When the user has set npm prefix to ~/.local (a common setup to avoid sudo for global npm installs), this path overlaps with where the native installer places its symlink (~/.local/bin/claude). The checker then incorrectly flags the native installation's own symlink as a separate npm-global installation.

Suggested Fix

The detection logic should verify that an actual npm package exists (e.g., check for $(npm prefix -g)/lib/node_modules/@anthropic-ai/claude-code/) rather than only checking for the binary at the npm global bin path.

View original on GitHub ↗

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