Part ofWhat Is Claude Code? The Complete Guide
Node.js for Claude Code: the native installer needs no Node, npm wants a current version. Setup with nvm and fixes for the classic failures.
In This Article
6 sectionsYou only need Node.js for Claude Code if you install the CLI through npm — the native installer ships a standalone binary with zero dependencies. The npm route historically required Node 18+, and as of v2.1.198 the package asks for Node 22+. Check yours with node --version; install or update through nvm.
We run this site with Claude Code every day — a Windows desktop, a MacBook, and two Linux runners — so we've hit every Node-related install failure the forums complain about. The good news is that most of them are now optional: since Anthropic shipped the native installer, Node stopped being a hard dependency. Below: what the official Claude Code requirements actually say, which Node version clears the bar, per-platform setup with nvm, and a fix table for the errors that still bite. New to the tool itself? Start with our pillar, What Is Claude Code?
Does Claude Code actually require Node.js?
Only on one install path. Anthropic's official setup documentation lists the Claude Code requirements as macOS 13+, Windows 10 1809+, or Ubuntu 20.04+/Debian 10+, 4 GB of RAM, and an internet connection. Node.js is not on the list. The recommended native installer downloads a self-contained binary, wires up your PATH, and auto-updates in the background:
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
The npm route is the legacy one. Anthropic deprecated it at v2.1.15 in favor of the native build, and the docs now file it under "advanced installation options." Here's the detail most people miss: the npm package installs the same native binary the standalone installer ships. npm pulls it in through a per-platform optional dependency and links it into place — your Node runs the installation, not Claude Code itself.
| Install method | Needs Node.js? | Updates | Command |
|---|---|---|---|
| Native installer (recommended) | No | Automatic, in the background | install.sh / install.ps1 script from claude.ai |
| Homebrew (macOS/Linux) | No | Manual: brew upgrade claude-code | brew install --cask claude-code |
| WinGet (Windows) | No | Manual: winget upgrade Anthropic.ClaudeCode | winget install Anthropic.ClaudeCode |
| npm (legacy) | Yes — 18+ historically, 22+ now | Needs a writable npm prefix | npm install -g @anthropic-ai/claude-code |
So the question of Node for the CLI splits cleanly. Fresh machine with no Node opinions: use the native installer and this whole problem class disappears. Existing toolchain where every global tool flows through npm: the legacy route still works, provided your Node version clears the bar below.
What version of Node for the CLI do you need?
The Node for the CLI version floor has moved twice. The original requirement was Node 18 or newer — that's where the "Claude Code requires Node.js version 18 or higher" message everyone has googled comes from. As of v2.1.198, the npm package declares Node 22+ in its engines field. And because the binary it installs never invokes your Node at runtime, an older version prints an EBADENGINE warning during install rather than failing — the install completes and claude still runs.
Checking your Claude Code Node version pairing takes one command each:
node --version # your Node runtime
claude --version # your Claude Code build
Then match your Node against the current lines:
| Node.js line | Status | npm install of Claude Code |
|---|---|---|
| 16 and older | End of life | Don't use it for anything, this included |
| 18 | End of life since April 30, 2025 | The old floor; warns on current packages |
| 20 | Maintenance ended April 30, 2026 | Installs with a warning; time to move on |
| 22 (LTS) | Supported | Meets the current engines requirement |
| 24 (LTS) | Supported | Our pick for new machines |
Our advice: forget the old Claude Code Node 18 floor entirely. Node 18 stopped receiving security patches in April 2025, so even though the CLI would tolerate it, nothing else on your machine should. Install 22 or 24 and both the historical and the current requirement are cleared at once.
How to install Node for the CLI on Windows, macOS, and Linux
When we set up Node.js for Claude Code on a new machine, we reach for a version manager, never a system-wide package. nvm installs Node into your home directory, which means no sudo, no root-owned npm prefix, and none of the EACCES permission failures that plague global installs. You install Node for Claude Code once, then switching or updating versions is one command:
nvm install --lts # newest long-term-support Node
nvm use --lts
nvm alias default 'lts/*' # every new shell starts on LTS
The same three commands give you a Node.js for Claude Code setup that survives OS upgrades and project version pins without breaking the CLI.
| Platform | Recommended | Also works |
|---|---|---|
| Windows | nvm-windows (a separate project, similar commands) or fnm | winget install OpenJS.NodeJS.LTS; the nodejs.org installer |
| macOS | nvm | brew install node@22 |
| Linux / WSL | nvm | NodeSource repos; distro packages (often stale) |
Three version-manager lessons we learned the hard way:
- Set the default alias. Without it, new shells — and GUI apps like VS Code launched from the dock — start with no Node on PATH at all. That single omission causes most "extension can't find Node" reports.
- Global packages don't follow you between versions. nvm keeps a separate global folder per Node line, so jumping from 18 to 22 makes an npm-installed
claudevanish. Reinstall it under the new version, or usenvm install --reinstall-packages-from=18. - Never
sudo npm install -g. Anthropic's docs warn against it explicitly. One sudo install leaves root-owned files in your prefix, and every future update fails with permission errors until you fix ownership.
Node-related Claude Code failures and their fixes
When Node.js for Claude Code goes wrong, the failures cluster into three groups: install-time errors from npm, launch-time errors from PATH, and runtime crashes. Work the table, then verify with claude doctor.
| Symptom | Cause | Fix |
|---|---|---|
| "Claude Code requires Node.js version 18 or higher" | Old Node — or the VS Code extension can't see Node on its PATH | nvm install --lts, open a fresh terminal; launch VS Code from a terminal so it inherits nvm's PATH; or go native |
EBADENGINE warning during npm install | Node older than 22 vs. the package's engines field | Warning only — the install completes; update Node to clear it |
EACCES / permission denied on npm install -g | Root-owned npm prefix from past sudo installs | Point the prefix at a user directory (or adopt nvm); never sudo |
claude: command not found after npm install | Global npm bin folder missing from PATH | npm config get prefix, add its bin to PATH — or go native |
claude vanished after a Node upgrade | nvm keeps globals per Node version | Reinstall under the new version, or migrate to the native build |
| Process exited with code 1 at launch | Stray env var, broken session file, outdated Node | Read the line above the error; full walkthrough in our exit code 1 guide |
One Windows-specific footnote: Claude Code prefers Git Bash for its shell tool, so a missing Git for Windows produces confusing failures that look Node-shaped but aren't. Install Git, or let the CLI fall back to PowerShell.
Verify the setup with claude doctor
claude --version proves the binary launches; claude doctor proves the setup is healthy. It reports your install type and version, the result of the last auto-update attempt, auth state, and config problems — and on npm installs it flags an unwritable global directory before that blocks your next update, listing the available fixes. We run it after every machine setup and after any Node change; the full command reference lives in our Claude Code CLI documentation guide.
Two closing habits keep the whole Node.js for Claude Code stack boring, which is the goal. First, update deliberately: claude update on demand, or trust the native installer's background updates. Second, if terminal plumbing is exactly what you're trying to avoid, the Claude Code Desktop app skips the CLI setup entirely — same agent, graphical shell, no PATH to debug.
Claude pricing at a glance
| Plan | Price |
|---|---|
| Free | $0 |
| Pro | $20 / month |
| Max | from $100 / month |
| API | Pay per token |
For the full breakdown of every plan, see our how much Claude costs guide.
Frequently Asked Questions

Written by
InnovateTechie
Writing about Claude and the Anthropic toolkit — models, Claude Code, pricing, features, and fixes, in clear, practical, hands-on guides tested by daily use.
View all posts →





