[BUG] npm install may conflict with native install

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 6 comments · opened Sep 17, 2025 · closed Sep 24, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

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

  1. Run npm install -g --prefix ~/.local @anthropic-ai/claude-code
  2. Run claude doctor
  3. 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).

View original on GitHub ↗

6 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7231
  2. https://github.com/anthropics/claude-code/issues/5540
  3. https://github.com/anthropics/claude-code/issues/4977

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

skogler · 1 year ago

Can confirm, I have the same issue, and can't get rid of the warning, even though I uninstalled claude with npm before installing the native one

ma11hew28 · 1 year ago

@skogler, after you install Claude Code globally with npm and run claude for the first time, Claude Code creates the configuration files ~/.claude, ~/.claude.json, and ~/.claude.json.backup. Uninstalling Claude Code with npm uninstall doesn't remove those files, which maybe npm uninstall should mention. (It also doesn't remove the empty directory ~/.local/lib/node_modules/@anthropic-ai, and maybe it should.) After reviewing the contents of those files, I simply deleted them, but you may want to back them up first, if you think they're important.

I haven't tried this, but maybe you could get rid of the warning like this:

  1. Uninstall Claude Code (native install)
  2. Remove the configuration files (listed above)
  3. Install Claude Code (native install)
ant-kurt collaborator · 1 year ago

This should be resolved in the next release.

ma11hew28 · 1 year ago

Awesome! Thanks!

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.