Skip to content
,

How to Install Claude Code on Windows, Mac and Linux (2026): No Node.js Needed, Update and Fix Errors

8–12 minutes
Surprised woman in glasses on a city street holding a card with the Claude logo, text one command, install Claude Code

Most “install Claude Code” tutorials still tell you to install Node.js first and run an npm command. That was true in 2025. Today the recommended route is a native installer that needs no Node.js at all.

This guide shows the one-line install for Windows, macOS and Linux, when Node.js still matters, how updates work, and how to fix every common error from “claude is not recognized” to a 403 during install.

TL;DR

  • Windows PowerShell: irm https://claude.ai/install.ps1 | iex
  • macOS, Linux, WSL: curl -fsSL https://claude.ai/install.sh | bash
  • Node.js: not needed for the native installer. Only the npm route needs Node.js 22 or newer.
  • Check it: open a new terminal and run claude --version, then claude doctor.
  • Account: you need Pro, Max, Ultra, Team, Enterprise or a Console (API) account. The Free plan cannot use Claude Code.
  • Updates: native installs update themselves. Force one with claude update.

System Requirements

Item Minimum
Windows Windows 10 1809+ or Windows Server 2019+ (64-bit only)
macOS macOS 13.0 Ventura or newer
Linux Ubuntu 20.04+, Debian 10+, Alpine 3.19+ (plus Fedora/RHEL via dnf)
Hardware 4 GB+ RAM, x64 or ARM64 CPU; about 512 MB free RAM during install
Shell Bash, Zsh, PowerShell or CMD
Network Internet access to downloads.claude.ai, from a supported country
Account Any paid Claude plan or a Console account with API credits

Note: Claude Code itself is a small client. All the AI runs on Anthropic’s servers, so you do not need a GPU. If you want to run it against a local model, see my Claude Code Router guide.

Which Install Method to Use

Method Command Auto-updates? Best for
Native installer install.ps1 / install.sh Yes Almost everyone
WinGet winget install Anthropic.ClaudeCode No (opt-in) Windows users who manage apps with WinGet
Homebrew brew install --cask claude-code No (opt-in) Mac users who use brew for everything
apt / dnf / apk Signed repos from Anthropic Via system updates Linux servers and teams
npm npm install -g @anthropic-ai/claude-code Yes, if npm folder is writable Node developers, CI images
Desktop app Download from claude.com Yes People who prefer no terminal

Install Claude Code on Windows

You can run Claude Code natively or inside WSL. Native is simplest; WSL 2 adds sandboxing and Linux tools.

  1. Open PowerShell. Press Start, type “PowerShell” and open Windows PowerShell (not the x86 entry). You do not need Administrator.
  2. Run the installer. Paste irm https://claude.ai/install.ps1 | iex and press Enter.
  3. Optional: install Git for Windows. With Git Bash present, Claude Code uses a Bash tool; without it, it uses PowerShell. Both work.
  4. Open a new terminal. The window you installed from keeps the old PATH.
  5. Check the version. Run claude --version. You should see a version number followed by (Claude Code).
  6. Start it in a project. cd into a folder and run claude.

Using CMD instead of PowerShell

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Tip: your prompt shows PS C:\ in PowerShell and just C:\ in CMD. Most Windows install errors come from pasting the command for the other shell.

Point Claude Code at Git Bash

If Git for Windows is installed in a custom place and Claude Code cannot find it, add this to ~/.claude/settings.json:

{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
  }
}

Installing inside WSL

Open your Ubuntu (or other) WSL terminal and use the Linux command below. Install and launch claude inside WSL, not from PowerShell. WSL setups do not need Git for Windows.

Install on macOS and Linux

  1. Open Terminal. On a Mac press Cmd+Space and type Terminal.
  2. Run the installer. curl -fsSL https://claude.ai/install.sh | bash
  3. Open a new window and run claude --version.
  4. Run a health check. claude doctor prints install health, settings errors and update status without starting a session.

The installer puts the launcher at ~/.local/bin/claude and versions under ~/.local/share/claude/versions/.

Homebrew

brew install --cask claude-code          # stable channel, about a week behind
brew install --cask claude-code@latest   # newest release

Ubuntu and Debian (apt)

sudo apt install curl gnupg
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc -o /etc/apt/keyrings/claude-code.asc
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update && sudo apt install claude-code

Check the key with gpg --show-keys /etc/apt/keyrings/claude-code.asc; the fingerprint must be 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE.

Alpine Linux

Alpine lacks bash and curl by default. Install the dependencies first, then set USE_BUILTIN_RIPGREP to 0 in settings:

apk add bash curl libgcc libstdc++ ripgrep

Do You Need Node.js? Installing With npm

Quick answer: no, not for the native installer, WinGet or Homebrew. You only need Node.js 22+ if you install through npm (required since Claude Code v2.1.198).

Even the npm package now just downloads the same native binary, so Claude Code never runs on your Node.js at runtime. On older Node versions npm prints an EBADENGINE warning but the install still completes.

  1. Install Node.js 22 LTS or newer from nodejs.org, or with winget install OpenJS.NodeJS.LTS on Windows.
  2. Check it: node -v should print v22 or higher.
  3. Install Claude Code: npm install -g @anthropic-ai/claude-code
  4. Upgrade later with npm install -g @anthropic-ai/claude-code@latest. Avoid npm update -g, which may not move to the newest release.

Warning: never run sudo npm install -g. It causes permission problems and security risks. If npm complains about permissions, switch to the native installer instead.

First Run and Login

  1. Start Claude Code in your project: claude
  2. Choose an account type. A claude.ai subscription (Pro, Max, Ultra, Team) or a Console account billed per token.
  3. Finish in the browser. If it does not open, press c to copy the login URL and paste it into any browser.
  4. API key users: if ANTHROPIC_API_KEY is set, Claude Code asks once to approve the key instead of opening a browser.
  5. Try a first prompt like “explain this project’s folder structure”.

Not sure which plan to pick? My Claude Code pricing guide compares Pro, Max, Ultra and API costs with real session examples.

How to Update Claude Code

Installed with Update command
Native installer Automatic; force with claude update
npm npm install -g @anthropic-ai/claude-code@latest
Homebrew brew upgrade claude-code (or claude-code@latest)
WinGet winget upgrade Anthropic.ClaudeCode
apt sudo apt update && sudo apt upgrade claude-code
dnf sudo dnf upgrade claude-code

Stable vs latest channel

  • latest (default): new features the day they ship.
  • stable: a build about one week old that skips releases with major regressions. Set it in /config, Auto-update channel, or add "autoUpdatesChannel": "stable" to settings.json.
  • Install a specific version: curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89
  • Turn off auto-updates: add "DISABLE_AUTOUPDATER": "1" under env in settings.json.
  • Brew or WinGet auto-update: set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1.

Once you are updated, my Claude Code commands cheat sheet lists every slash command and flag.

How to Uninstall Claude Code

Installed with Remove with
Native (macOS/Linux) rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude
Native (Windows) Remove-Item "$env:USERPROFILE\.local\bin\claude.exe" -Force and Remove-Item "$env:USERPROFILE\.local\share\claude" -Recurse -Force
npm npm uninstall -g @anthropic-ai/claude-code
Homebrew brew uninstall --cask claude-code
WinGet winget uninstall Anthropic.ClaudeCode
apt sudo apt remove claude-code and delete the repo list and key

Warning: deleting ~/.claude and ~/.claude.json removes all settings, MCP servers and session history. The VS Code extension, JetBrains plugin and desktop app recreate ~/.claude, so remove them first for a full clean-up.

Fix Install and Login Errors

“claude is not recognized” or “command not found: claude”

The install worked but its folder is not on your PATH. On macOS with Zsh:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

On Linux with Bash, use ~/.bashrc instead. On Windows PowerShell:

$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Then close every terminal, including ones inside VS Code, and open a new one.

“irm is not recognized” or “The token ‘&&’ is not a valid statement separator”

You pasted the PowerShell command into CMD, or the CMD command into PowerShell. Use the command that matches your prompt. 'bash' is not recognized means you used the Mac/Linux command on Windows.

“syntax error near unexpected token ‘<‘” or curl 403

The install URL returned a web page instead of the script. Common causes:

  • “App unavailable in region”: Claude Code is not offered in your country.
  • Corporate proxy or firewall: it is blocking downloads.claude.ai.
  • Temporary outage: wait a few minutes, or use winget install Anthropic.ClaudeCode or brew install --cask claude-code.

“running scripts is disabled on this system”

PowerShell’s execution policy blocks npm’s .ps1 shims. Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, call claude.cmd instead, or switch to the native installer.

“Error: claude native binary not installed” after npm install

npm skipped the optional platform package or its postinstall step. Remove --omit=optional or --ignore-scripts (and optional=false in .npmrc), then reinstall, or run node node_modules/@anthropic-ai/claude-code/install.cjs.

“Killed” during install on a small Linux server

The server ran out of memory. The install needs about 512 MB free. Add a 2 GB swap file or close other services, then run the installer again.

claude.exe disappears right after an update on Windows

Restore the backup the updater left behind:

Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe

OAuth error: Invalid code, or login stuck in WSL/SSH

The code expired or was cut off. Retry quickly, press c to copy the full URL, or run claude auth login. In WSL2 you can set BROWSER to your Windows Chrome path.

“API Error: 403 Request not allowed” after login

Check your subscription is active at claude.ai/settings. Console users need the “Claude Code” or “Developer” role from an admin. A corporate proxy can also cause it.

My Take

If you are on Windows, just use the one-line PowerShell installer and skip Node.js entirely. It updates itself and avoids every npm permission problem people hit in 2025.

On Linux servers I prefer the signed apt or dnf repository on the stable channel, so updates arrive with normal system patches. Whichever route you pick, run claude doctor once after installing; it catches PATH, settings and update problems before they bite.

Ready to compare it with other agents? Read my Cursor vs Windsurf vs Claude Code vs Cline comparison.

FAQ

Do I need Node.js for Claude Code?

No. The native installer, WinGet and Homebrew need no Node.js. Only the npm package needs Node.js 22 or newer.

What is the command to install Claude Code on Windows?

In PowerShell run irm https://claude.ai/install.ps1 | iex. In CMD use the install.cmd command shown above, or winget install Anthropic.ClaudeCode.

How do I update Claude Code?

Native installs update automatically; run claude update to update now. npm, Homebrew and WinGet installs need their own upgrade command.

Can I install Claude Code for free?

The software is free, but signing in needs a paid Claude plan or a Console account with API credits. The free claude.ai plan does not include it.

Where is Claude Code installed?

Native installs live in ~/.local/bin/claude (or %USERPROFILE%\.local\bin\claude.exe) with versions in ~/.local/share/claude. Settings live in ~/.claude.

Should I use WSL or native Windows?

Native Windows is simpler for Windows projects. Pick WSL 2 if your toolchain is Linux-based or you want sandboxed command execution.

Does Claude Code need a GPU?

No. The model runs on Anthropic’s servers. You only need a GPU if you connect Claude Code to a local model through Ollama or a router.

How do I check my installation is healthy?

Run claude doctor. It reports install health, settings errors, auto-update status and suggested fixes without starting a session.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Surprised woman in glasses on a city street holding a card with the Claude logo, text one command, install Claude Code