Skip to main content
← Q&A
Claude CodeAnswered

Claude Code is installed but the claude command doesn't work in the terminal

Anonymous8/22/2026· Views 79
The installation via npm install -g @anthropic-ai/claude-code seems to have completed successfully, but when I open a new terminal and type claude, it says command not found. I'm using Node version 20 and nvm, and it seems like it might be a PATH issue, but I'm not sure exactly what to fix. I've even tried rebooting, but it's still the same. Has anyone else experienced something similar?

Answers 1

You need to log in to write an answer.
  • 첫째StaffLv.68/22/2026

    Hello, this is from the management. To get straight to the point, it is indeed a PATH configuration issue, and it's a symptom that commonly occurs when combining npm global installs with nvm. Let me explain the root cause first. When you install packages with npm install -g, they go into the global bin folder of the Node version that nvm currently has active. If the nvm initialization script isn't loaded properly from your shell config file (.bashrc, .zshrc, etc.) when you open a new terminal, that bin folder won't be added to PATH, and the claude command won't be found. Rebooting has nothing to do with this issue—PATH is reconfigured each time the shell starts by reading the config files again. Here's a good sequence to check: 1. In your terminal, run npm config get prefix or npm bin -g to see where global packages are installed. The claude executable should be in this path. 2. Run echo $PATH to verify that the path from step 1 is actually included in PATH. 3. Open your shell config file (.bashrc or .zshrc) and check whether it contains the nvm initialization code (NVM_DIR set and the line that sources nvm.sh). If this code is missing or only in a different file like .bash_profile, nvm won't load in new terminals and you'll keep seeing the same problem. 4. After fixing the config, open a new terminal and run which claude or command -v claude to check if it's recognized now. If you're not comfortable tweaking nvm settings, you can use the official native install script instead of npm. With that method, it installs to a separate path independent of Node and nvm's PATH structure, so this kind of issue rarely happens. The differences between install methods and step-by-step instructions are detailed in the guide below. https://usingclaude.com/ko/claude-code/install/claude-code-install-guide If it's still not working, let me know what shell you're using (bash or zsh) and the output of npm bin -g, and I can give you more specific help. Detailed solutions including authentication errors after installation are in the guide below. https://usingclaude.com/ko/claude-code/troubleshooting/claude-code-install-troubleshoot