[BUG] `claude update` falsely reports leftover npm global install when native launcher is in npm global prefix directory
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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
- Install Claude Code using the recommended native installer:
``bash``
curl -fsSL https://claude.ai/install.sh | bash
- Use an npm global prefix that resolves to
~/.local:
``bash``
npm prefix -g
# /home/<user>/.local
- Verify the Claude launcher is native:
``bash``
ls -l ~/.local/bin/claude
# ~/.local/bin/claude -> ~/.local/share/claude/versions/2.1.128
- Verify the deprecated npm package is not installed:
``bash``
npm list -g --depth=0 @anthropic-ai/claude-code
# empty / not installed
- Run:
``bash``
claude update
- Observe that Claude Code reports both
npm-globalandnativeat the same launcher path and recommendsnpm -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.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗