[BUG] Incorrect Installation Diagnostics for npm-global Installation

Open 💬 13 comments Opened Sep 30, 2025 by Philsmith1

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 Code 2.0.1 shows incorrect installation diagnostic warnings when installed via npm install -g, claiming it's a "native" installation and reporting configuration mismatches, even though the installation is functioning correctly.

Environment
Claude Code Version: 2.0.1
Installation Method: npm global (npm install -g @anthropic-ai/claude-code)
OS: macOS
Node Version: v22.19.0
npm Version: 11.6.1

Installation Details

bash
$ which claude
/usr/local/bin/claude

$ ls -la /usr/local/bin/claude
lrwxr-xr-x  1 user  wheel  52 [date] /usr/local/bin/claude -> ../lib/node_modules/@anthropic-ai/claude-code/cli.js

$ npm list -g --depth=0 | grep claude
├── @anthropic-ai/claude-code@2.0.1

What Should Happen?

When installed via npm install -g, Claude Code should:

Correctly detect the installation method as npm-global
Not show warnings about native installation paths
Not report configuration mismatches between detected and actual installation method

Error Messages/Logs

**System Diagnostics**
  ⚠  installMethod is native, but claude command not found at /Users/[username]/.local/bin/claude
  ⚠  Insufficient permissions for auto-updates
  ⚠  No write permissions for auto-updates (requires sudo)
  ⚠  Installation config mismatch: running npm-global but config says native

Steps to Reproduce

  1. Install Claude Code globally: npm install -g @anthropic-ai/claude-code
  2. Verify installation: which claude (should show /usr/local/bin/claude)
  3. Create config file at ~/.claude/config.jsonwith:
json   {
"installMethod": "npm-global"
}
  1. Run claude in any project directory
  2. Observe the system diagnostics warnings

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.1 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Investigation Results
Looking at the compiled CLI code, the b$() function correctly detects npm-global based on the binary path:

javascriptif(["/usr/local/lib/node_modules", ...].some((Z)=>A.includes(Z)))
  return"npm-global";

However, the diagnostics code appears to be checking for a native installation configuration somewhere else, possibly in a cached state or different config location.

Additional Context

  • The warnings persist even after:
  1. Creating/updating ~/.claude/config.json
  2. Killing all Claude processes with pkill -f claude
  3. Clearing cache with rm -rf ~/.claude/.cache
  • The actual functionality of Claude Code works correctly despite these warnings
  • Config files checked:
  1. ~/.claude/config.json ✓ (set to npm-global)
  2. ~/.claude/settings.json✓ (contains only alwaysThinkingEnabled)
  3. ~/.claude/plugins/config.json ✓ (contains only repositories)

Workaround
Setting DISABLE_INSTALLATION_CHECKS=1 environment variable suppresses the warnings.

Suggested Fix
The diagnostics logic should respect the runtime-detected installation method (npm-global) and not compare it against a potentially stale or incorrectly initialized "native" configuration value. The detection logic in b$() appears correct, but the diagnostics validation logic may need to be updated to use the same detection method.

View original on GitHub ↗

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