Skip to main content
← Q&A
TroubleshootingAnswered

I installed Claude Code but typing claude gives command not found

Anonymous10/18/2026· Views 74
I installed Claude Code on my Mac with npm, and it finished without any errors. But when I type claude in the terminal, all I get is command not found. Closing and reopening the terminal doesn't help either. It seems like a PATH issue, but I don't know where to look or what to do. What's the usual first thing to check for this? Would reinstalling fix it?

Answers 1

You need to log in to write an answer.
  • 첫째StaffLv.710/26/2026

    Hi there, this is the site team. To cut to the chase, the install itself probably worked, and the most likely cause is a PATH issue where the terminal can't find the claude executable. In this case, reinstalling alone often gives the same result. A global npm install puts the executable in the bin folder under npm's global prefix folder. If that folder isn't in your PATH, you'll see 'command not found' even though the install finished without errors. Closing and reopening the terminal won't fix it, since the cause stays the same, so you'll get the same result. Here's the order to check: 1. Check the install: Enter npm list -g @anthropic-ai/claude-code and see whether it shows up in the list of installed packages. 2. Check the global folder: Enter npm prefix -g to get the path. Use ls to check whether a claude file is in the bin folder under that path. 3. Check PATH: Look at the output of echo $PATH and see whether that bin path is included. 4. If it's not there, on a Mac using the default shell (zsh), add one line to your ~/.zshrc file: export PATH="(path from step 2)/bin:$PATH", then run source ~/.zshrc. You'll need to replace the part in parentheses with your actual path. Also, if you used sudo to get past a permission error during install, the paths or permissions may have gotten tangled. In that case, the usual approach is to change npm's global folder to somewhere under your home directory rather than installing with sudo. Anthropic also documents native install methods besides npm. Please check the official docs (code.claude.com) for the latest install commands. I haven't verified this part in real time. In short, reinstalling is unlikely to fix this if PATH stays the same. Please try the steps above first, and if it still doesn't work, leave a comment with the output of each command and we'll keep looking into it with you. We've covered install and login errors in detail in the guide below. https://usingclaude.com/ko/claude-code/troubleshooting/claude-code-install-troubleshoot