Node.js for Claude Code: which version, and how to skip it
The npm route needs Node.js 18 or newer — node -v to check; nvm (nvm install --lts) to fix. Older Node is the most common reason a fresh install will not start. If Node is not part of your toolchain, skip it: the native installer below ships a standalone binary and updates itself.
Option 1 — npm (any OS with Node.js 18+)
npm install -g @anthropic-ai/claude-code
claude --version
If npm install -g fails with EACCES on macOS or Linux, do not use sudo — fix the npm prefix instead: npm config set prefix ~/.npm-global and add ~/.npm-global/bin to your PATH. On Windows, run the install from a normal (non-admin) terminal.
Option 2 — native installer for Mac, Linux and Windows (no Node.js)
# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
# Windows CMD (the one-liner people search for)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Install Claude Code on Linux and Ubuntu
On Ubuntu, Debian, Fedora or any distro: the native installer (curl -fsSL https://claude.ai/install.sh | bash) drops a self-updating binary in your home directory and needs no root and no Node.js. If you prefer npm, install Node 18+ from NodeSource or nvm first — Ubuntu's apt Node is usually too old — then npm install -g @anthropic-ai/claude-code. In a terminal-only server or a container, the native binary is the better choice; add the two gateway variables to ~/.bashrc and it works over SSH exactly as it does locally.
The native build updates itself and avoids Node version conflicts. It is the better choice on machines where Node is not already part of your toolchain.
Option 3 — desktop app or IDE extension
The Claude desktop app bundles Claude Code, and the VS Code and JetBrains extensions install the CLI for you on first use. See the web, desktop and IDE guide for what each surface can and cannot do.
Windows notes
Claude Code runs natively on Windows 10/11 (PowerShell or Git Bash) and inside WSL. WSL is the smoother experience for projects that assume a Unix shell. If claude is not found after an npm install on Windows, open a new terminal so PATH is re-read, or check npm config get prefix and add its bin folder.
Run Claude Code without login: authenticate with an API key
Run claude and choose /login to sign in with a Claude Pro/Max subscription — or skip the login entirely. With ANTHROPIC_API_KEY (or ANTHROPIC_AUTH_TOKEN) set, Claude Code never shows the login screen and runs locally against whatever endpoint ANTHROPIC_BASE_URL names, which is also how it runs on machines that cannot open a browser. For this gateway, use the key route:
export ANTHROPIC_BASE_URL=https://aiprimetech.io
export ANTHROPIC_API_KEY=your_gateway_key # or ANTHROPIC_AUTH_TOKEN
claude
Put those two lines in ~/.zshrc, ~/.bashrc or your PowerShell profile so every new terminal has them. Inside Claude Code, /status shows which endpoint and key are active.
How to update and uninstall Claude Code
claude update # native / self-update
npm update -g @anthropic-ai/claude-code # npm install
npm uninstall -g @anthropic-ai/claude-code
If the install worked but Claude Code will not start
command not found→ PATH: open a new shell, or add npm's global bin directory.Node versionerrors → Node.js 18 or newer is required;node -vto check, or switch to the native installer.- Hangs on first launch → corporate proxy; set HTTPS_PROXY, or the gateway base URL if your network blocks api.anthropic.com.
401/ invalid key → the key must be a gateway key when ANTHROPIC_BASE_URL points here; an Anthropic console key will be rejected.
Frequently asked questions
Do I need Node.js to install Claude Code?
Only for the npm route. The native installer (curl on macOS/Linux, PowerShell on Windows) and the desktop app do not need Node.
Does Claude Code run on Windows?
Yes, natively in PowerShell or Git Bash, and inside WSL. WSL is recommended for Unix-shaped projects.
Can I install Claude Code without a Claude subscription?
Yes. Install is free; authenticate with an API key instead of /login. A gateway key from this site works as a drop-in.
Run Claude Code on the gateway
Same models, two environment variables, credits at 7.69231× face value — or a flat-rate unlimited plan.
Get an API key See unlimited plansAI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.