TechBuzzPro

Claude Code Windows Not Recognized? Fix It Fast

· 6 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If Windows says Claude Code is not recognized when you type claude in Command Prompt or PowerShell, the usual cause is that the Claude Code CLI is not installed, or its install folder is not on your PATH. The quickest fix is to install or reinstall the official CLI and then open a fresh terminal window so Windows picks up the updated PATH. Below are the exact steps, what to check when it still fails, and the mistakes that keep the error coming back.

What You'll Need

  • A Windows 10 or Windows 11 PC with an internet connection.
  • Node.js and npm installed from the official Node.js website (the LTS installer is fine). Claude Code is distributed as an npm package.
  • Access to PowerShell or Command Prompt. PowerShell is recommended because it shows clearer error messages.
  • Your Claude account credentials, in case the CLI asks you to sign in after installation.

Step-by-Step

  1. Close every terminal window. PATH changes only apply to terminals opened after the change. If you have Command Prompt, PowerShell, or Windows Terminal open, close them all before continuing.
  2. Check whether Node.js and npm are installed. Open a new PowerShell window and run node --version and npm --version. If either command is not recognized, install Node.js from the official site first, then reopen PowerShell. Claude Code will not work without npm.
  3. Install the Claude Code CLI. In PowerShell, run npm install -g @anthropic-ai/claude-code. The -g flag installs it globally so the claude command is available from any folder. Wait for the install to finish without errors.
  4. Confirm where npm puts global commands. Run npm config get prefix. On Windows this is usually C:\Users\YourName\AppData\Roaming\npm. That folder must be on your PATH for claude to be found.
  5. Add the npm global folder to PATH if it is missing. Open Settings > System > About > Advanced system settings > Environment Variables. Under User variables, select Path and click Edit. If the npm folder from the previous step is not listed, click New and paste it in, then click OK on every dialog. Labels can differ slightly by Windows version, but the Environment Variables dialog is the same on Windows 10 and 11.
  6. Open a brand-new PowerShell window and test. Run claude --version. If it prints a version number, the command is now recognized. If it still says not recognized, run where.exe claude to see whether Windows can locate the executable at all.
  7. Start Claude Code. Change to your project folder with cd and run claude. The first launch may ask you to sign in or confirm trust for the folder. Follow the on-screen prompts.
  8. If you use Git Bash or WSL, test there separately. A command that works in PowerShell may not be on the PATH inside Git Bash or WSL. Open the terminal you actually plan to use and repeat the version check there.

Common Mistakes

  • Testing in the same old terminal. The most common reason the fix appears not to work is that the terminal was opened before PATH was changed. Always open a new window.
  • Installing without -g. A local install puts the command inside a project's node_modules folder, so claude is not available globally. Reinstall with the global flag.
  • Editing the wrong Path variable. There are User and System Path entries. Adding the npm folder to User Path is usually enough and avoids needing administrator rights.
  • Typing the wrong command. The command is claude, not claude-code or claudecode. Check spelling before troubleshooting further.
  • Mixing up PowerShell and Command Prompt syntax. Commands like where.exe work in both, but some setup steps differ. When in doubt, use PowerShell.

Tips

  • Run npm update -g @anthropic-ai/claude-code occasionally to keep the CLI current; older versions can behave oddly after Windows updates.
  • If you use a version manager for Node.js, its global prefix may be in a different folder. Check npm config get prefix after switching Node versions.
  • Keep the npm global folder out of OneDrive-synced directories if possible; sync conflicts can lock files during installation.
  • Use Windows Terminal instead of the legacy console for better output and easier copy-paste of error messages.

Troubleshooting

If claude --version still fails after the steps above, work through these checks in order.

  1. Verify the install actually succeeded. Run npm list -g --depth=0 and look for @anthropic-ai/claude-code in the list. If it is missing, rerun the install command and read any error text carefully.
  2. Check for permission errors during install. If npm reports EACCES or permission denied, close the terminal, reopen PowerShell as administrator only if necessary, and reinstall. On a standard user account, a global install to your user folder should not need admin rights.
  3. Look for a stale shim. If where.exe claude points to an old or broken file, delete the claude and claude.cmd files from the npm folder, then reinstall.
  4. Restart the PC. Some PATH changes are not picked up by already-running processes, including the Start menu and some IDE terminals. A reboot clears that up.
  5. Try the full path. Run the command using its full location, for example & "$env:APPDATA\npm\claude.cmd" in PowerShell. If that works, the problem is definitely PATH, not the installation.
  6. Check antivirus or corporate policy. Some security tools block newly installed command-line tools. If you are on a work machine, ask IT whether npm global installs are allowed.

If none of this helps, uninstall the package with npm uninstall -g @anthropic-ai/claude-code, reinstall Node.js from the official installer, and then reinstall Claude Code. This resets the npm environment without touching your project files.

Frequently Asked Questions

Why does Windows say claude is not recognized when it is installed?

Almost always because the npm global folder is not on your PATH, or because the terminal was opened before the PATH change. Open a new terminal and check npm config get prefix against your Path entries.

Do I need Node.js to run Claude Code on Windows?

Yes. The CLI is installed through npm, so Node.js and npm must be present and working before the install command will succeed.

Does Claude Code work in Command Prompt as well as PowerShell?

Yes, once the command is on your PATH it works in both. PowerShell is recommended for clearer error output and easier quoting.

Can I use Claude Code in WSL or Git Bash?

You can run it in those environments, but each has its own PATH. Install and test inside the terminal you plan to use, because a working PowerShell install does not automatically make the command available in WSL.

Is it safe to add the npm folder to PATH?

Yes. It is a standard user folder that npm uses for global commands. Adding it does not grant extra privileges or change system files.

What should I do if the install command itself fails?

Read the npm error text. Common causes are a missing Node.js install, no internet access, or security software blocking the download. Fix that first, then rerun the install.