Wrong Node.js Version in PATH Fix (2026)

The Error

Error: Claude Code requires Node.js >= 18.0.0
  Current version: v16.20.2 (from /usr/local/bin/node)
  Your PATH resolves to an older Node.js installation
  Claude Code cannot start with this Node.js version

This appears when your system PATH points to an old Node.js version that does not meet Claude Code’s minimum requirement.

The Fix

nvm use 20
claude
  1. Switch to Node.js 20 (or 18+) using your version manager.
  2. Verify the correct version is active: node --version.
  3. Run Claude Code — it should now start successfully.

Why This Happens

Many systems have multiple Node.js installations: a system version in /usr/local/bin, Homebrew’s version, and nvm/fnm managed versions. The PATH order determines which node binary runs. If the system version (often outdated) appears earlier in PATH than the nvm version, Claude Code picks up the old one. This commonly happens in new terminal sessions where nvm’s shell initialization has not run, or in non-interactive shells used by IDE terminals.

If That Doesn’t Work

Install Node.js 20 if not present:

nvm install 20
nvm alias default 20

Check which node binary is being used:

which node
node --version
echo $PATH | tr ':' '\n' | grep -i node

Set the correct version as default:

nvm alias default 20
# Or with fnm:
fnm default 20

If using Homebrew:

brew install node@20
brew link --overwrite node@20

Prevention

# CLAUDE.md rule
This project requires Node.js 20+. Run 'nvm use 20' or 'fnm use 20' before starting Claude Code. Add an .nvmrc file with '20' to the project root for automatic version switching.

See Also

This fix also applies if you see variations of this error:

  • Connection or process errors with similar root causes in the same subsystem
  • Timeout variants where the operation starts but does not complete
  • Permission variants where access is denied to the same resource
  • Configuration variants where the same setting is missing or malformed

If your specific error message differs slightly from the one shown above, the fix is likely the same. The key indicator is the operation that failed (shown in the stack trace) rather than the exact wording of the message.

Frequently Asked Questions

Does this error affect all operating systems?

This error can occur on macOS, Linux, and Windows (WSL). The exact error message may differ slightly between platforms, but the root cause and fix are the same. macOS users may see additional Gatekeeper or notarization prompts. Linux users should check that the relevant system packages are installed. Windows users should ensure they are running inside WSL2, not native Windows.

Will this error come back after updating Claude Code?

Updates can occasionally reintroduce this error if the update changes default configurations or dependency requirements. After updating Claude Code, verify your project still builds and runs correctly. If the error returns, reapply the fix and check the changelog for breaking changes.

Can this error cause data loss?

No, this error occurs before or during an operation and does not corrupt existing files. Claude Code’s edit operations are atomic — they either complete fully or not at all. However, if the error occurs during a multi-step operation, you may have partial changes that need to be reviewed with git diff before continuing.

How do I report this error to Anthropic if the fix does not work?

Open an issue at github.com/anthropics/claude-code with: (1) the full error message including stack trace, (2) your Node.js version (node --version), (3) your Claude Code version (claude --version), (4) your operating system and version, and (5) the command or operation that triggered the error.

Try it: Paste your error into our Error Diagnostic for an instant fix.