macOS
curl -fsSL https://claude.ai/install.sh | bash
Checked against the Claude Code docs · 4 OctDocs checked · 4 Oct No Node.js needed 25 install errors, each with its fix

Install Claude Code on Any Computer (and Fix Every Install Error)

Pick your system, copy one command, and see what a good install looks like. If it fails, paste the error below for the exact fix.

macOS selected
Terminal (zsh)
$ curl -fsSL https://claude.ai/install.sh | bash
  1. Open a new terminal window so PATH is fresh.
  2. Run claude --version to confirm.
  3. Run claude and log in with your plan.

Apple Silicon and Intel. If claude is not found afterwards, open a new window first.

How do I install Claude Code?

Short answer

On macOS, Linux or WSL run curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell run irm https://claude.ai/install.ps1 | iex. Open a new terminal, run claude --version to confirm, then claude to log in. You need a paid Claude plan or an API account; Node.js is not required.

The native installer is the shortest correct path. It downloads one binary into ~/.local/bin, adds nothing to your system Node, and updates itself in the background. Older guides still teach npm install -g; that route works, but it brings back the Node version and permission errors the native installer removed.

Is Claude Code free?

Short answer

No. Claude Code needs a paid Claude plan (Pro, Max, Team or Enterprise) or a Console API account billed per token. The free claude.ai plan does not include it. The software itself installs at no cost, so you can install first and log in once your plan is active.

Three checks before you install, sixty seconds in total:

01 · plan

A paid plan or API account

Pro, Max, Team, Enterprise or Console. The login step fails on a free account, not the install.

02 · system

A supported OS

macOS 13+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+ or Alpine 3.19+. 64-bit only.

03 · memory

4 GB of RAM

More is comfortable, but less has worked. Low-memory servers can kill the installer itself.

It runs fine for me on an old ThinkPad X220 loaded with 8 GB
aquariusDue · Hacker News · Jun 2026

Which install method should you use?

All six methods install the same Claude Code. They differ in what happens three weeks later, when a new version ships. That is the column nobody else compares, and the one that decides which method you will be happy with.

Method chooser: three questions
Your system
Updates without asking?
Managed by IT?
Use this

Native installer

curl -fsSL https://claude.ai/install.sh | bash

Updates itself in the background and needs no Node or admin rights.

MethodNeeds NodeAuto-updatesAdmin rightsBest for
Native installerNoYes, in the backgroundNoAlmost everyone
HomebrewNoNo: brew upgradeNoMacs managed with brew
WinGetNoNo: winget upgradeSometimesWindows fleets
apt, dnf, apkNoNo: package managerYes (sudo)Linux servers
npmYes, 22+NoNo, with a user prefixLegacy setups only
DevcontainerNoOn rebuildDockerIsolated, unattended runs
Homebrew: claude-code follows stable, claude-code@latest follows latest.
Homebrew installations do not auto-update.
Claude Code docs · Advanced setup

Install Claude Code on macOS

Open Terminal, paste the installer, then open a new window so your shell picks up ~/.local/bin. If claude is still not found, the folder is missing from your PATH:

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

One trap catches people who installed through npm years ago: Homebrew's Node can leave a claude symlink pointing at nothing. Remove the npm copy first, then run the native installer.

claude command not found after npm install -g on macOS with Homebrew due to incorrect symlink
GitHub issue #3172

Windows: native or WSL2?

Native Windows is the simpler start. WSL2 is the better home if your code already lives in Linux or you want the built-in sandbox, which only runs there. Either way, the most common Windows failure is running the right command in the wrong shell. Look at your prompt first:

PowerShell: the prompt starts with PS
PS C:\Users\you> irm https://claude.ai/install.ps1 | iex
Command Prompt: no PS in front
C:\Users\you> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Windows PowerShell in Windows Terminal with the command wsl --install typed at the prompt, the first step of setting up WSL2
Step one for WSL2: run wsl --install in PowerShell, restart, then run the Claude Code installer inside Ubuntu. Screenshot: Microsoft Learn, CC BY 4.0.
If you see The token '&&' is not a valid statement separator, you're in PowerShell, not CMD.
Claude Code docs · Advanced setup
FeatureNative WindowsWSL2
Built-in sandboxNoYes
Shell Claude usesPowerShell, or Git Bash if installedbash
Image pasteWorksOften breaks: save the file and pass its path
LoginOpens your browserCopy the URL into a Windows browser if it does not open
32-bit WindowsNot supportedNot supported

Two more Windows surprises: installing the Claude desktop app can take over the claude command in PATH, and Shift+Enter for a new line needs /terminal-setup in some terminals.

Copying an image in Windows and pressing Ctrl+V in Claude Code doesn't work
rajveerb · Hacker News · May 2026

Install Claude Code on Linux, Alpine and Docker

The same install.sh works on glibc distributions. Alpine and other musl systems need three libraries and the system ripgrep, because the bundled one is built for glibc:

Debian, Ubuntu, Fedora
$ curl -fsSL https://claude.ai/install.sh | bash
Alpine (musl)
# apk add bash curl libgcc libstdc++ ripgrep
export USE_BUILTIN_RIPGREP=0
curl -fsSL https://claude.ai/install.sh | bash

On a 1 GB VPS the installer can be killed for memory before it finishes; add swap first (the fix is in the error finder below). In Docker, run the install as the user who will run claude, not as root, or the binary lands in root's home.

Check that it works

Three commands, in order. The first proves the binary is on your PATH, the second checks the install and update setup, the third starts the login. The output lines below are examples; your version number will differ.

check the binary
$ claude --version
2.1.211 (Claude Code)
check the install · example output
$ claude doctor
Install method: native · Auto-updates: enabled · Version: 2.1.211
start and log in
$ claude
Opens your browser to log in. Paste the code back if it asks.

Paste your error: the install error finder

Paste the whole error or just a few words. Every card names the cause in one line, gives the fix you can copy, and links the official doc or GitHub issue it came from. Each card has its own link, so you can send someone straight to the fix.

All 25 errors
claude: command not found

Cause: The installer put claude in ~/.local/bin, which is not on your PATH yet, or you have not opened a new terminal since installing.

zsh or bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrcsource ~/.zshrcclaude --version

On bash on Linux, use ~/.bashrc instead of ~/.zshrc. On bash on macOS, use ~/.bash_profile. Opening a new terminal also reloads PATH.

'claude' is not recognized as an internal or external command, operable program or batch file

Cause: The Windows PATH was not refreshed in this terminal, or %USERPROFILE%\.local\bin is not on your user PATH.

PowerShell
$env:PATH -split ';' | Select-String '\.local\bin'$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Run these in PowerShell: the first command checks PATH, the other two add the folder. Then restart your terminal and run claude --version. In CMD, add %USERPROFILE%\.local\bin to your user PATH in System Settings, Environment Variables.

bash: line 1: syntax error near unexpected token `<'

Cause: The install URL returned an HTML page (a block, a captive portal, a proxy error page, a 403 or a region restriction) and the shell tried to run it.

zsh or bash
curl -fsSL https://claude.ai/install.sh | head -c 200

If the output is an HTML page (its first line is a DOCTYPE tag) rather than a shell script, you are not getting the script. Try another network, switch off the VPN or proxy, or use the Homebrew (brew install --cask claude-code) or WinGet (winget install Anthropic.ClaudeCode) method instead.

curl: (56) Failure writing output to destination

Cause: Bash did not receive the complete install script. Exit code 56 means the download was interrupted; code 23 means curl could not write to the pipe, usually because Bash exited early.

zsh or bash
curl -sI https://downloads.claude.ai/claude-code-releases/latestcurl -fsSL https://claude.ai/install.sh | bash

The first command checks that you can reach the download server (a first line of HTTP/2 200 is good). If you can, the failure was probably intermittent, so run the install again. Otherwise try another network or an alternative install method.

curl: (35) TLS connect error

Cause: A corporate proxy or antivirus is intercepting HTTPS with its own certificate that your system does not trust, or your system certificates are out of date.

zsh or bash
sudo apt-get update && sudo apt-get install ca-certificatescurl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bashexport NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem

First command: Ubuntu and Debian CA update. Second: install through a proxy that inspects TLS, using the CA file from IT. Third: make Claude Code itself trust that CA once installed. On Windows, enable TLS 1.2 in PowerShell or install with WinGet.

Failed to fetch version from downloads.claude.ai

Cause: The installer could not reach the download server, usually because downloads.claude.ai is blocked by a proxy or firewall.

zsh or bash
curl -sI https://downloads.claude.ai/claude-code-releases/latestexport HTTPS_PROXY=http://your-proxy:portcurl -fsSL https://claude.ai/install.sh | bash

The first command should print HTTP/2 200 on its first line. Replace the proxy address with your own and set HTTP_PROXY as well. A 403 usually means a network filter or an unsupported region.

The token '&&' is not a valid statement separator in this version.

Cause: You ran the CMD install command in Windows PowerShell. The PowerShell prompt starts with PS C:\.

PowerShell
irm https://claude.ai/install.ps1 | iex

In PowerShell use the command above. The && form is for CMD.

'irm' is not recognized as an internal or external command

Cause: You ran the PowerShell command in CMD. irm and iex only exist in PowerShell.

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

Or open PowerShell (a prompt that starts with PS C:\) and run irm https://claude.ai/install.ps1 | iex.

Failed to download binary: The process cannot access the file because it is being used by another process

Cause: The installer could not write to %USERPROFILE%\.claude\downloads. A previous install attempt is still running, or antivirus is scanning a half-downloaded binary there.

PowerShell
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\downloads"irm https://claude.ai/install.ps1 | iex

Close other PowerShell windows running the installer, wait for antivirus scans to finish, then run both commands in PowerShell.

Killed

Cause: A small server or container ran out of memory and the Linux out-of-memory killer stopped the installer (exit code 137). The install needs roughly 512 MB of free memory.

bash
free -hsudo fallocate -l 2G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfilecurl -fsSL https://claude.ai/install.sh | bash

Add swap, then run the installer again. Running Claude Code needs more than installing it: the system requirements say 4 GB of RAM or more.

Raw mode is not supported on the current process.stdin

Cause: During install, your organisation's server-managed settings need an approval dialog, and a dialog needs a terminal. When the installer runs from a pipe (curl ... | bash) there is none. Versions before 2.1.246 try to show the dialog during install.

zsh or bash
curl -fsSL https://claude.ai/install.sh | bashclaude --version

Run the installer again: it installs the latest release, which skips the dialog and shows it in your next interactive session instead. The exception is organisations that force a fail-closed settings refresh at startup.

Illegal instruction

Cause: The native binary uses CPU instructions your processor does not have. Either the installer downloaded the wrong architecture (for example x86 on an ARM server) or the CPU lacks AVX (roughly pre-2013 chips, or a VM that hides AVX from the guest).

bash
uname -mgrep -m1 -ow avx /proc/cpuinfo

If uname -m does not match the binary you got, report it on GitHub. An empty result from the second command means no AVX. There is no native-binary workaround, and alternative install methods download the same binary; the docs track it in GitHub issue 50384.

dyld: Symbol not found

Cause: The binary is incompatible with your macOS version or hardware. Claude Code requires macOS 13.0 or later.

zsh
sw_vers -productVersion

If the version is below 13.0, update macOS. Homebrew and other install methods download the same binary, so they will not fix this.

cannot execute binary file: Exec format error

Cause: The distribution is running under WSL 1 and hits a known native-binary regression (GitHub issue 38788): WSL 1's loader cannot handle the binary's program headers.

PowerShell
wsl -l -vwsl --set-version <DistroName> 2

Run these in PowerShell and replace <DistroName> with the name the first command lists, for example Ubuntu. To stay on WSL 1, the docs show a shell function for ~/.bashrc that starts the binary through /lib64/ld-linux-x86-64.so.2.

EACCES: permission denied

Cause: The global npm folder (or the install folder) is not writable by your user. Do not fix this with sudo.

zsh or bash
curl -fsSL https://claude.ai/install.sh | bash

The native installer needs no npm permissions. If a native install fails on permissions, check that ~/.local/bin and ~/.claude are writable. Never run sudo npm install -g.

EBADENGINE Unsupported engine (Node.js version warning on npm install)

Cause: The npm package asks for Node.js 22 or later. On an older Node.js, npm prints an EBADENGINE warning but the install still completes and claude still runs, because the package downloads a native binary that does not use your Node.js at runtime. Older Claude Code releases (the era of GitHub issue 8410) did require Node 18.

zsh or bash
node --versioncurl -fsSL https://claude.ai/install.sh | bash

The native installer needs no Node.js at all. If you use npm, upgrade Node to 22 or newer to silence the warning.

'claude' is not recognized after an update, and claude.exe is missing

Cause: To update on Windows, Claude Code renames the existing claude.exe to a backup and moves the new version in. If that second step fails (often antivirus), claude.exe is left missing and the backup is named claude.exe.old.<timestamp>.

PowerShell
Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.execlaude --versionirm https://claude.ai/install.ps1 | iex

Run in PowerShell. Rename the newest backup back to claude.exe. If there is no backup, or claude still fails, run the last command to reinstall. Check your antivirus quarantine list too. WinGet (winget install Anthropic.ClaudeCode) is an alternative.

OAuth error: timeout of 15000ms exceeded

Cause: The login request cannot reach the Anthropic auth servers: DNS, VPN, proxy, IPv6 or firewall. A user report in GitHub issue 33238 found auth.anthropic.com failing to resolve.

zsh or bash
nslookup auth.anthropic.comclaude auth login

Try a different network or switch off the VPN. If the browser cannot open or reach Claude Code, press c at the login prompt to copy the login URL and open it in a browser on your own machine, then paste the code back. On WSL2, SSH and containers this paste-the-code flow is the normal path.

Source: GitHub issue #33238#err-oauth-timeout
OAuth error: Invalid code. Please make sure the full code was copied

Cause: The login code expired or was truncated when you copied it, often because the terminal wrapped the line.

zsh or bash
claude auth login

Press Enter at the prompt to retry and finish the login quickly after the browser opens. Type c to copy the full login URL if the browser does not open. In a remote or SSH session, open the URL in your local browser.

API Error: 403 Request not allowed

Cause: The login worked but the request was refused: an inactive Pro or Max subscription, a Console account without the Claude Code or Developer role, or a proxy interfering with API requests.

Pro and Max users: check your subscription is active at claude.ai/settings. Console users: ask an admin to give you the Claude Code or Developer role (Console, Settings, Members). Behind a proxy, see the network configuration docs.

Claude Code access has not been granted for this account. Contact your administrator.

Cause: Your Claude Enterprise organisation set your role to Custom, and none of the custom roles assigned to your groups grants Claude Code. Nothing you change in Claude Code fixes this.

zsh or bash
claude

Ask an Owner of your Claude organisation to assign a custom role that grants Claude Code to one of your groups, or to change your role from Custom to a standard role such as User. Then run claude and log in again. Separately, the free claude.ai plan does not include Claude Code: you need Pro, Max, Team, Enterprise or a Console account.

This organization has been disabled (or Missing API key) after login

Cause: An old ANTHROPIC_API_KEY in your shell profile overrides your subscription login, so you see "This organization has been disabled" despite an active plan. In non-interactive mode (-p) the key is always used when present.

zsh or bash
echo "${ANTHROPIC_API_KEY:+set}"unset ANTHROPIC_API_KEYclaude

If the first command prints set, remove the variable and delete any export ANTHROPIC_API_KEY line from ~/.zshrc, ~/.bashrc or ~/.profile. Run /status inside Claude Code to confirm which login is active. A separate case, GitHub issue 5244, was a macOS login that was not persisted.

Not logged in. Please run /login

Cause: Your saved login expired or was revoked. On macOS it can also mean the login Keychain is locked or out of sync, so Claude Code could not save the login.

zsh or bash
claude doctorsecurity unlock-keychain ~/Library/Keychains/login.keychain-db

Run /login inside Claude Code. If it keeps happening, check that your system clock is correct. On macOS, claude doctor warns when the Keychain is not writable: unlock it with the second command, then /logout and /login.

Ctrl+V does not paste an image in WSL

Cause: WSL hands Windows clipboard images to Linux in an old BMP format, and your terminal may grab Ctrl+V for text.

WSL terminal
claude

Use Alt+V to paste an image on Windows and WSL (Ctrl+V is also bound on WSL). If the clipboard route still fails, save the image as a PNG and give Claude Code its file path or drag the file into the terminal.

Error loading shared library libstdc++.so.6: No such file or directory

Cause: On Alpine and other musl distributions the minimal image lacks the C++ runtime Claude Code needs. (On a glibc system, the cause can instead be a musl binary installed by mistake.)

sh (Alpine)
apk add bash curl libgcc libstdc++ ripgrepldd --version 2>&1 | head -1

Install the packages, then set USE_BUILTIN_RIPGREP to 0 in the env block of ~/.claude/settings.json so it uses the system ripgrep. The second command shows whether you are on glibc or musl. If apk cannot find ripgrep, add the Alpine community repository.

Login and billing gotchas

Most "it installed but will not work" reports are login problems. Three rules cover nearly all of them:

  • An API key wins. If ANTHROPIC_API_KEY is set in your shell, Claude Code asks once whether to use it, and from then on bills the API instead of your subscription. Unset it if you meant to use your plan.
  • Reset a stuck login with /logout, then /login. Run /status to see which account and billing route is active.
  • Over SSH or in a container, the browser cannot open on the remote machine. Copy the login URL into a local browser and paste the code back.
The free claude.ai plan does not include Claude Code access.
Claude Code docs · Advanced setup

How do I update Claude Code?

Short answer

Native installs update themselves in the background; run claude update to update now. Homebrew, WinGet and Linux package installs do not auto-update: use brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or your package manager. Run claude doctor to see your version and the last update result.

When a release breaks something, pin. Install an exact version, slow the channel down, or stop updates while you wait for a fix:

install an exact version
$ curl -fsSL https://claude.ai/install.sh | bash -s 2.1.211

Swap in any earlier version number to roll back. Auto-updates resume unless you also stop them.

you must downgrade your version now to login
pixel_popping · Hacker News · Apr 2026, during a login regression

How do I uninstall Claude Code?

Short answer

Remove it the same way you installed it: delete ~/.local/bin/claude and ~/.local/share/claude for native installs, or run brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode, or npm uninstall -g @anthropic-ai/claude-code. Delete ~/.claude and ~/.claude.json too, but only if you also want your settings and history gone.

Native (macOS, Linux, WSL)
$ rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
Optional: also delete settings, history and MCP config
$ rm -rf ~/.claude ~/.claude.json

Your first hour after install

  1. Run /init in your project. It writes a CLAUDE.md with the build commands and layout. Keep it short: every line is read on every turn.
  2. Run /context to see what fills the window. Heavy MCP servers and copied-in CLAUDE.md files are the usual culprits; the MCP servers worth adding to Claude Code page lists what each one costs.
  3. Install the CLI tools you want it to use, such as ripgrep, pandoc or imagemagick, and say so in CLAUDE.md.
  4. Set up safety once: the built-in sandbox, a separate OS user for risky projects, and min-release-age=7 in .npmrc so fresh packages wait a week.
  5. Decide where memory lives. Claude Code forgets everything between sessions. CLAUDE.md covers project rules; for personal memory across projects, a local memory MCP such as Locul fills the gap.
Since Claude Code uses a 1 hour prompt cache window for the main agent
bcherny, Claude Code team · Hacker News · Apr 2026. Sessions left idle longer than an hour start cold.
Highly encourage people having issues to do /context and start removing heavy things.
mh- · Hacker News · Feb 2026

Run it anywhere

devcontainer

A sealed box for long runs

The official repo ships a devcontainer with a firewall. Use it for unattended work.

tailscale + ssh + tmux

From your phone

Leave a session in tmux, reach it over Tailscale, pick it up anywhere.

vs code · jetbrains

Inside your editor

Both extensions run the same CLI underneath, with diffs in the editor.

desktop app

No terminal at all

The Claude desktop app includes Claude Code for people who never open a shell.

Want it to talk to a model on your own machine? The local LLM hardware calculator shows what your GPU or Mac can run, and how fast.

Install Tailscale on WSL2 and your iPhone
bobjordan · Hacker News · Jan 2026

Questions people ask

Do I need Node.js?

No. The native installer ships one binary. Only the npm route uses Node.js, and it asks for version 22 or newer; on older versions npm prints a warning and still installs.

Should I use WSL or native Windows?

Native if you just want it working today. WSL2 if your projects live in Linux or you want the built-in sandbox, which only runs there.

Why does it say "claude: command not found"?

Your shell has not picked up ~/.local/bin. Open a new terminal; if that fails, add the folder to PATH. The first card in the error finder has the exact line.

Why does login time out?

Usually DNS: auth.anthropic.com does not resolve behind some VPNs and filtering resolvers. Check with nslookup auth.anthropic.com.

How do I stop or restart Claude Code?

Press Esc to stop the current step, Ctrl+C twice to quit. Run claude --continue to pick up the last session.

Is Claude Code down, or is it me?

Check status.anthropic.com first. If it is green, run claude doctor and look for your error in the finder.

Can I install it without admin rights?

Yes. The native installer writes only to your home folder.

Sources

  1. Advanced setup, Claude Code docs
  2. Troubleshoot installation, Claude Code docs
  3. Install WSL, Microsoft Learn
  4. GitHub issues #3172, #8410, #14942, #33238, #5244
  5. Hacker News threads credited beside each quote

Changelog

  • 4 Oct: every command, error string and fix checked against the Claude Code setup and troubleshooting docs.
  • 4 Oct: the error finder has 25 cards, each linked to its source.
  • First published with the OS picker and method comparison.