Claude Code ‘Command Not Found’: Install & PATH Fixes

Claude Code ‘Command Not Found’: Install & PATH Fixes

CLAUDE CODE · CLI Command Not Found AI FIX HUB

Updated June 2026

You installed Claude Code, opened a new terminal, typed claude — and got command not found. This is almost always a PATH or Node setup issue, not a broken install. Here’s the fix.

⚡ Quick fix

  • Open a new terminal window after installing.
  • Make sure your npm global bin is on your PATH.
  • Use Node 18+ — older versions fail silently.
  • On macOS/Linux, reload your shell: source ~/.zshrc.

1. Add the npm global bin to your PATH

If you installed via npm, the claude binary lives in your npm global folder. If that folder isn’t on your PATH, the shell can’t find it.

  1. Find the folder: npm config get prefix.
  2. The binary is in that folder’s /bin subdirectory.
  3. Add it to your shell profile (~/.zshrc or ~/.bashrc): export PATH="$PATH:$(npm config get prefix)/bin".
  4. Reload: source ~/.zshrc.
Fastest test: run which claude. Empty output means it’s a PATH problem — the steps above fix it.

2. Check your Node version

Claude Code needs a modern Node runtime. An old version installs but won’t run.

  1. Run node -v.
  2. If it’s below 18, update via nvm install --lts or your installer.
  3. Reinstall Claude Code after upgrading Node.

3. Fix permission (EACCES) errors

If the install itself failed with EACCES, the binary never got written.

Don’t use sudo for npm global installs. It causes more permission problems. Instead, point npm at a user-owned folder.
  1. Create a folder: mkdir ~/.npm-global.
  2. Set it: npm config set prefix ~/.npm-global.
  3. Add ~/.npm-global/bin to PATH and reinstall.

4. Windows-specific notes

Issue Fix
Works in CMD, not PowerShell Restart the terminal / reboot to refresh PATH
Installed but not found Add %APPDATA%\npm to your PATH
Native module errors Use the latest Node LTS and reinstall

FAQ

Do I need to restart my terminal? Yes — PATH changes only apply to new sessions.

Can I install without npm? Check the official docs for the native installer if npm keeps failing.

In short: put the npm global bin on your PATH, use Node 18+, and open a fresh terminal — that clears the error.

Written by

Carlos Valdés Rivas is the independent editor of AI Fix Hub. Articles are researched and drafted with AI assistance, then structured and reviewed before publishing — see our Editorial Policy and AI Use Disclosure. Found an issue? See our Corrections Policy.

📚 More to Explore