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.
- Find the folder:
npm config get prefix. - The binary is in that folder’s
/binsubdirectory. - Add it to your shell profile (
~/.zshrcor~/.bashrc):export PATH="$PATH:$(npm config get prefix)/bin". - Reload:
source ~/.zshrc.
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.
- Run
node -v. - If it’s below 18, update via
nvm install --ltsor your installer. - Reinstall Claude Code after upgrading Node.
3. Fix permission (EACCES) errors
If the install itself failed with EACCES, the binary never got written.
- Create a folder:
mkdir ~/.npm-global. - Set it:
npm config set prefix ~/.npm-global. - Add
~/.npm-global/binto 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.
