Skip to main content
← Q&A
Claude CodeAnswered

Claude Code installed but claude command not found

Anonymous7/30/2026· Views 218
npm install -g @anthropic-ai/claude-code shows it installed successfully, but when I open a new terminal I get "claude: command not found". I know I need to add npm's global path to PATH, but I'm not sure where to add it. I'm on Mac and installed Node with nvm—is that related? I tried restarting but it's still the same.

Answers 1

You need to log in to write an answer.
  • 첫째StaffLv.67/31/2026

    Hello, this is the admin. To cut to the chase — the problem happens because the npm global installation directory isn't in your PATH, and if you're using nvm, that's likely the culprit. When you install with npm install -g, the claude command gets created in npm's global bin folder. If you're managing Node with nvm, this path changes depending on the Node version (for example, ~/.nvm/versions/node/version/bin). If nvm doesn't load the same version as when you installed it when you open a new terminal, that bin path gets dropped from PATH and you can't find claude. Here's the order I recommend checking: 1. Run which -a claude and npm -g ls @anthropic-ai/claude-code in your terminal to see exactly where it's installed. 2. Run echo $PATH to check if nvm's Node version bin path is included. 3. If you run nvm alias default your-installed-version, the same version will load every time you open a new terminal, which helps reduce PATH issues. 4. If you're on Mac using the default zsh shell, check that your ~/.zshrc actually contains the nvm init script (the export NVM_DIR and nvm.sh loading part). If that script is only in other files like .bash_profile, nvm itself won't load in new zsh terminals. If that doesn't work, you can try reinstalling with the official native installation script instead of npm. That tends to have fewer PATH-related issues. The guide below covers the differences between installation methods in detail. https://usingclaude.com/ko/claude-code/install/claude-code-install-guide This article also covers installation and login errors more broadly and might be helpful: https://usingclaude.com/ko/claude-code/troubleshooting/claude-code-install-troubleshoot