[BUG] The CLI reports that the Claude command is not found but still works

Resolved 💬 17 comments Opened Aug 5, 2025 by kud Closed Nov 10, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.68 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: iTerm2

Bug Description

The CLI reports that the Claude command is not found at /Users/xxx/.local/bin/claude, and indicates that ~/.local/bin is not in the PATH, despite the command working from /opt/homebrew/bin/claude.

Steps to Reproduce

  1. Try running the claude command from the terminal.
  2. Observe the error message stating the command is not found in the specified directory.
  3. However, using which claude shows it working from /opt/homebrew/bin/claude.

Expected Behavior

The claude command should execute without error, given that it works from /opt/homebrew/bin and is symlinked correctly.

Actual Behavior

An error message appears stating that the command is not found at /Users/xxx/.local/bin/claude and suggests adding ~/.local/bin to the PATH, though it isn't the correct directory for this command.

Additional Context

  • Error message details:
  • Claude command not found at /Users/mest001/.local/bin/claude
  • ~/.local/bin is not in your PATH
  • Suggests adding it to the PATH using export PATH="~/.local/bin:$PATH"
  • The which claude command confirms it works from /opt/homebrew/bin/claude.
  • The symlink details:

``shell
/opt/homebrew/bin/claude ⇒ ../lib/node_modules/@anthropic-ai/claude-code/cli.js
``

  • Additional terminal output suggests network issues with connection errors and retries.
  • It was installed via npm.

View original on GitHub ↗

17 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/2824
  2. https://github.com/anthropics/claude-code/issues/4453
  3. https://github.com/anthropics/claude-code/issues/3172

If your issue is a duplicate, please close it and 👍 the existing issue instead.

🤖 Generated with Claude Code

kud · 11 months ago

Hey there.

Is there any reason why we need Claude in .local/bin?

I've set my npm prefix that way, Claude works well but I still have the message.

🔍 Command: claude
────────────────────
claude is /Users/xxx/.npm-global/bin/claude

ℹ️  Additional Information:
Version: 1.0.81 (Claude Code)
File type: a /usr/bin/env node script text executable, ASCII text, with very long lines (29314)
Size: 52B
josh-at-block · 10 months ago

Also reporting the same; using claude with NPM installed globally, i.e.

✗ which claude
/Users/xxxx/.nvm/versions/node/v24.6.0/bin/claude

however Claude still works fine.

khalic-lab · 10 months ago

Possible solution: show npm error in claude? I had the same issue that was caused by a wrong .npmrc config

jpreed2 · 10 months ago

Same problem. Running in WSL2. Nothing in my PATH referencing any claude folders. Seems to be working fine otherwise.

 ● Claude command not found at /home/jpreed/.local/bin/claude

jpreed@XPS-8960:~$ which claude
/home/jpreed/.nvm/versions/node/v22.18.0/bin/claude
mrns · 10 months ago

@jim5359

If you are seeing ● Claude command not found at /Users/[your_user]/.local/bin/claude, then:

  • Run claude config get --global installMethod outside claude code
  • Run /doctor inside claude.

If your installMethod shows as "native" and claude doctor command shows Config install method: npm, then:

  • Run claude config set --global installMethod npm

My guess is that this happens when you tried switching from npm installation to native without noticing some claude session was still running which messes up the configuration.

ryanspooner · 10 months ago

@mrns This did the trick!

@jim5359 If you are seeing ● Claude command not found at /Users/[your_user]/.local/bin/claude, then: Run claude config get --global installMethod outside claude code Run /doctor inside claude. If your installMethod shows as "native" and claude doctor command shows Config install method: npm, then: * Run claude config set --global installMethod npm My guess is that this happens when you tried switching from npm installation to native without noticing some claude session was still running which messes up the configuration.
jpreed2 · 10 months ago

@mrns Thanks for the tip. For me, ironically, it turns out turning off WSL support solved the problem, even though I'm using WSL. The WSL support allows specifying the exact location of the binaries, but apparently it didn't work in my setup and turning it off did.

xjones · 9 months ago

@jim5359 's suggestion did not resolve this for me. I'm using Homebrew to install claude and I have installMethod set to homebrew. I still get:

● Native installation exists but ~/.local/bin is not in your PATH.
Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >>
~/.config/zsh/.zshrc && source ~/.config/zsh/.zshrc

When I launch Claude and running /doctor within claude shows:

Diagnostics
 └ Currently running: native (1.0.117)
 └ Path: /opt/homebrew/bin/claude
 └ Invoked: /opt/homebrew/Caskroom/claude-code/1.0.117/claude
 └ Config install method: homebrew
 └ Auto-updates enabled: false
 └ Search: OK (bundled)
 Warning: Native installation exists but ~/.local/bin is not in your
  PATH
 Fix: Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >>
 ~/.config/zsh/.zshrc then open a new terminal or run: source
 ~/.config/zsh/.zshrc
 Warning: Running native installation but config install method is 
 'homebrew'
 Fix: Run claude install to update configuration

 Press Enter to continue…

Running claude install of course installs claude in ~/.local/bin but that is not what I want. Any other suggestions on how to get rid of the false error?

ernestns · 9 months ago

I had initially used the native installer and switched to npm, I resolved this by updating "installMethod": "native", to "installMethod": "npm", in ~/.claude.json

alamothe · 9 months ago

Can you please provide a working brew installation? This is getting ridiculous. Why would I use npm to install it? npm sucks big time

hnykda · 9 months ago

Yeah, I am getting the same issue, there is no config option anymore, install via brew on Mac:

[I] ❰dan❙~/a(git:main)❱✔≻ claude doctor

 Diagnostics
 └ Currently running: native (2.0.8)
 └ Path: /opt/homebrew/bin/claude
 └ Invoked: /opt/homebrew/Caskroom/claude-code/2.0.8/claude
 └ Config install method: unknown
 └ Auto-updates enabled: default (true)
 └ Search: OK (bundled)
 Warning: Running native installation but config install method is 'unknown'
 Fix: Run claude install to update configuration
 Warning: Leftover npm global installation at /opt/homebrew/bin/claude
 Fix: Run: npm -g uninstall @anthropic-ai/claude-code

 Press Enter to continue…
dellis23 · 9 months ago

What does "native" even mean in this context? Claude code stopped working for me randomly, I suspect because of some auto-update mechnism, and I'm trying to diagnose it. I don't see anything other than an npm installation instruction in the readme. My install says my "installMethod is native" but can't find the binary, and /doctor says I have multiple installations but doesn't tell me what to do about that.

Edit for anyone else that might be running into this. The readme doesn't link to this advanced instructions page, which has other setup methods. I have no clue how mine got screwed up though. Just suddenly stopped working.

dragonfax · 8 months ago

Upgrading the claude-code formula in brew fixed this for me.

kud · 8 months ago

Yeah I don't have the issue anymore too.

mangubee · 8 months ago
Upgrading the claude-code formula in brew fixed this for me.

This work for me too, thanks

github-actions[bot] · 7 months 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.