npm → standalone migration doesn't detect or warn about existing npm install

Resolved 💬 5 comments Opened Feb 17, 2026 by rocket289k Closed Mar 18, 2026

Description

When migrating from the npm-installed @anthropic-ai/claude-code to the standalone installer, the standalone installer does not detect or warn about an existing npm global installation. Both installations can coexist on PATH, leading to silent version conflicts where the user may unknowingly run the wrong version.

Expected Behavior

The standalone installer (or claude itself on first standalone run) should:

  1. Detect if @anthropic-ai/claude-code is installed globally via npm (check npm list -g @anthropic-ai/claude-code or look for shims in the npm global bin)
  2. Warn the user that both versions exist and may conflict
  3. Offer to clean up the npm installation (or at minimum, instruct the user to run npm uninstall -g @anthropic-ai/claude-code)

Actual Behavior

  • No detection or warning occurs
  • Both claude binaries can exist on PATH (e.g., %APPDATA%\npm\claude.cmd from npm and %USERPROFILE%\.local\bin\claude.exe from standalone)
  • Whichever appears first in PATH wins silently — the user may be running the old npm version without realizing it
  • Version pinning (e.g., in settings.json) may apply to one install but not the other, compounding confusion

Steps to Reproduce

  1. Install Claude Code via npm install -g @anthropic-ai/claude-code
  2. Later install the standalone version (e.g., via the installer or curl method)
  3. Run where claude (Windows) or which -a claude (macOS/Linux)
  4. Observe both binaries on PATH with no warning

Environment

  • OS: Windows 11
  • Claude Code: 2.1.44 (standalone)
  • Node.js: v24.13.0

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗