[BUG] Incorrect Installation Diagnostics for npm-global Installation
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
- Install Claude Code globally:
npm install -g @anthropic-ai/claude-code - Verify installation:
which claude(should show/usr/local/bin/claude) - Create config file at
~/.claude/config.jsonwith:
json {
"installMethod": "npm-global"
}
- Run
claudein any project directory - 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:
- Creating/updating
~/.claude/config.json - Killing all Claude processes with
pkill -f claude - Clearing cache with
rm -rf ~/.claude/.cache
- The actual functionality of Claude Code works correctly despite these warnings
- Config files checked:
~/.claude/config.json✓ (set tonpm-global)~/.claude/settings.json✓ (contains onlyalwaysThinkingEnabled)~/.claude/plugins/config.json✓ (contains onlyrepositories)
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.
This issue has 13 comments on GitHub. Read the full discussion on GitHub ↗