/doctor falsely flags native installer as 'Leftover npm global installation'
Bug
/doctor reports a false positive about a leftover npm installation when Claude Code was installed via the official native installer (not npm).
Reproduction
- Install Claude Code using the official native installer (currently active install path).
- Run
/doctor.
Expected
No warning — this is the canonical install layout.
Actual
- Leftover npm global installation at /Users/<user>/.local/bin/claude
Suggested fix: Run: npm -g uninstall @anthropic-ai/claude-code
The suggested fix has no effect because there is no npm package present:
$ npm -g uninstall @anthropic-ai/claude-code
up to date in 651ms
Diagnostic data
- Claude Code:
v2.1.126 - Symlink target:
~/.local/bin/claude → ~/.local/share/claude/versions/2.1.126 - Versions present in cache:
2.1.121, 2.1.122, 2.1.123, 2.1.126(rolling native-installer cache) - OS: macOS Darwin 22.6.0 x86_64
which -a claude: returns only the native installer path (no duplicates)npm list -g --depth=0 | grep claude: empty
Root cause hypothesis
The detection in /doctor likely flags any claude binary under ~/.local/bin/ as npm-installed without verifying that the symlink target points to ~/.local/share/claude/versions/, which is the canonical native-installer layout.
Suggested fix
When checking for npm leftovers, exclude binaries whose resolved symlink target is under ~/.local/share/claude/versions/. Alternatively, additionally verify with npm list -g whether the package is actually present before reporting.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗