[BUG] Config mismatch: running npm-global but config says unknown (NVM + WSL2 environment)
Claude Code shows persistent config mismatch warning when installed via npm-global in NVM environment on WSL2. Tool functions correctly despite the warning.
Environment Info
Platform: Anthropic API
Claude CLI version: 1.0.77
Operating System: Windows 11 Pro (24H2, Build 26100.4652) + WSL2 Ubuntu 24.04.2 LTS
Terminal: Cursor IDE terminal connected to WSL2 Ubuntu
Shell: Zsh 5.9 with Oh My Zsh
Node.js: v22.17.1 (managed via NVM 0.40.3)
Installation method: npm install -g @anthropic-ai/claude-code
Installation path: /home/mp/.nvm/versions/node/v22.17.1/bin/claude
Steps to Reproduce
- Install Claude Code via npm global in NVM environment:
npm install -g @anthropic-ai/claude-code - Launch Claude Code:
claude - Run
/statuscommand - Observe config mismatch warning in System Diagnostics section
Expected Behaviour
No config mismatch warning should appear when installation method is correctly detected.
Actual Behaviour
Warning displays: ⚠ Config mismatch: running npm-global but config says unknown ⚠❌
Diagnostic Output
/doctor command:
> /doctor
⎿ (no content)
Diagnostics
└ Currently running: npm-global (1.0.77)
└ Path: /home/mp/.nvm/versions/node/v22.17.1/bin/node
└ Invoked: /home/mp/.nvm/versions/node/v22.17.1/bin/claude
└ Config install method: unknown
└ Auto-updates enabled: true
└ Update permissions: Yes
Memory Files · 0.7k tokens
└ Project (/home/mp/projects/python/text-analyser/CLAUDE.md): 0.7k tokens
Agent Configurations
└ Loaded custom agents: 0
/status command:
Claude Code v1.0.77
L Session ID: [Redacted]
Working Directory
L /home/mp/projects/python/text-analyser
System Diagnostics • /doctor
⚠ Config mismatch: running npm-global but config says unknown [It's here ❌]
IDE Integration • /config
✔ Connected to Cursor extension
✔ Installed Cursor extension
Account • /login
L Login Method: Claude Max Account
L Organization: [Redacted]
L Email: [Redacted]
Memory • /memory
L project: CLAUDE.md
Model • /model
L opusplan (claude-opus-4-1-20250805)
Additional Notes
- Claude Code functions normally despite the warning
- Issue appears to be detection logic not recognising NVM-based npm-global installations
/migrate-installerresolves the issue but requires migration to local installation- Related to previous issues #3915 (closed) and ongoing #4977 (custom npm prefix)
Workaround ✅
Running /migrate-installer resolves the warning by migrating to local installation.
Output from /doctor now:
> /doctor
⎿ (no content)
Diagnostics
└ Currently running: npm-local (1.0.77)
└ Path: /home/mp/.nvm/versions/node/v22.17.1/bin/node
└ Invoked: /home/mp/.claude/local/node_modules/.bin/claude
└ Config install method: local
└ Auto-updates enabled: true
Memory Files · 0.7k tokens
└ Project (/home/mp/projects/python/text-analyser/CLAUDE.md): 0.7k tokens
Agent Configurations
└ Loaded custom agents: 0
Output form /status now:
> /status
⎿ (no content)
Claude Code v1.0.77
L Session ID: [Redacted]
Working Directory
L /home/mp/projects/python/text-analyser
IDE Integration • /config
✔ Connected to Cursor extension
✔ Installed Cursor extension
Account • /login
L Login Method: Claude Max Account
L Organization: [redacted]
L Email: [redacted]
Memory • /memory
L project: CLAUDE.md
Model • /model
L opusplan (claude-opus-4-1-20250805)This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗