Skip to content

[BUG] claude update falsely reports leftover npm global install when native launcher is in npm global prefix directory #56399

Description

@kAIborg24

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

claude update reports a leftover npm global installation even when @anthropic-ai/claude-code is not installed via npm.

This appears to happen when the native Claude Code launcher is installed at ~/.local/bin/claude and npm's global prefix is also ~/.local. Claude Code seems to classify the launcher path as npm-global based on the npm prefix/bin directory, even though the actual launcher is the native install symlink.

Verified local state:

~/.local/bin/claude -> ~/.local/share/claude/versions/2.1.128

The npm global package is absent:

npm list -g --depth=0 @anthropic-ai/claude-code
# empty / not installed

Running the suggested cleanup command is a no-op:

npm -g uninstall @anthropic-ai/claude-code
# up to date

### What Should Happen?

If `@anthropic-ai/claude-code` is not installed in the npm global package tree, `claude update` should not report a leftover npm global installation.

It should recognize the launcher as native when:

```text
~/.local/bin/claude -> ~/.local/share/claude/versions/<version>

### Error Messages/Logs

```shell
$ claude update
Current version: 2.1.128
Checking for updates to latest version...

Warning: Multiple installations found
- npm-global at /home/<user>/.local/bin/claude
- native at /home/<user>/.local/bin/claude (currently running)

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

$ npm -g uninstall @anthropic-ai/claude-code

up to date in 123ms

Steps to Reproduce

  1. Install Claude Code using the recommended native installer:

    curl -fsSL https://claude.ai/install.sh | bash
  2. Use an npm global prefix that resolves to ~/.local:

    npm prefix -g
    # /home/<user>/.local
  3. Verify the Claude launcher is native:

    ls -l ~/.local/bin/claude
    # ~/.local/bin/claude -> ~/.local/share/claude/versions/2.1.128
  4. Verify the deprecated npm package is not installed:

    npm list -g --depth=0 @anthropic-ai/claude-code
    # empty / not installed
  5. Run:

    claude update
  6. Observe that Claude Code reports both npm-global and native at the same launcher path and recommends npm -g uninstall @anthropic-ai/claude-code, even though the npm package is already absent.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

Unknown

Claude Code Version

2.1.128 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

The warning disappears if npm's prefix is overridden for the command:

NPM_CONFIG_PREFIX="$HOME/.npm-global" claude update

That suggests the detection is based on npm global prefix/path overlap rather than actual npm package presence.

Impact: this does not block updates, but it creates a persistent misleading warning and recommends a cleanup command that cannot resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions