[BUG] npm install may conflict with native install
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?
If the npm install has the same prefix (~/.local) as the native install, then claude doctor thinks the former is the latter and that both are installed, and claude install doesn't uninstall the former and install the latter.
What Should Happen?
claude doctor should realize I'm running npm-global (not native) and that native isn't installed.
claude install should uninstall npm-global and install native.
Error Messages/Logs
$ claude doctor
Diagnostics
└ Currently running: native (1.0.115)
└ Path: /usr/local/bin/node
└ Invoked: ~/.local/bin/claude
└ Config install method: unknown
└ Auto-updates enabled: default (true)
└ Search: OK (vendor)
Warning: Multiple installations found
└ npm-global at ~/.local/bin/claude
└ native at ~/.local/bin/claude
Warning: Running native installation but config install method is 'unknown'
Fix: Run claude install to update configuration
Warning: Leftover npm global installation at ~/.local/bin/claude
Fix: Run: npm -g uninstall @anthropic-ai/claude-code
Steps to Reproduce
- Run
npm install -g --prefix ~/.local @anthropic-ai/claude-code - Run
claude doctor - Run
claude install
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.115 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Claude Docs: Set up Claude Code: Standard installation says: "Do NOT use sudo npm install -g", but on macOS, you need to use sudo to write to npm's default global prefix (/usr/local), so I ran npm config set prefix=~/.local before running npm install. But to simplify the "Steps to Reproduce" (above), I just added --prefix ~/.local to npm install (in step 1).
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗