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.
- 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, thenclaude 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.
- Open PowerShell. Press Start, type “PowerShell” and open Windows PowerShell (not the x86 entry). You do not need Administrator.
- Run the installer. Paste
irm https://claude.ai/install.ps1 | iexand press Enter. - Optional: install Git for Windows. With Git Bash present, Claude Code uses a Bash tool; without it, it uses PowerShell. Both work.
- Open a new terminal. The window you installed from keeps the old PATH.
- Check the version. Run
claude --version. You should see a version number followed by(Claude Code). - Start it in a project.
cdinto a folder and runclaude.
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
- Open Terminal. On a Mac press Cmd+Space and type Terminal.
- Run the installer.
curl -fsSL https://claude.ai/install.sh | bash - Open a new window and run
claude --version. - Run a health check.
claude doctorprints 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
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.
- Install Node.js 22 LTS or newer from nodejs.org, or with
winget install OpenJS.NodeJS.LTSon Windows. - Check it:
node -vshould print v22 or higher. - Install Claude Code:
npm install -g @anthropic-ai/claude-code - Upgrade later with
npm install -g @anthropic-ai/claude-code@latest. Avoidnpm 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
- Start Claude Code in your project:
claude - Choose an account type. A claude.ai subscription (Pro, Max, Ultra, Team) or a Console account billed per token.
- Finish in the browser. If it does not open, press
cto copy the login URL and paste it into any browser. - API key users: if
ANTHROPIC_API_KEYis set, Claude Code asks once to approve the key instead of opening a browser. - 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"underenvin 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.ClaudeCodeorbrew 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.




