Claude Code Installation
One-command install for Windows, macOS, and Linux. Native installers, Homebrew, and npm. Up and running in under two minutes, no Node.js required.
Problem: You want to install Claude Code but are not sure where to start. Here is the shortest path from zero to a working AI terminal.
How to Install Claude Code: Quick Start
Anthropic now ships native installers as the recommended method. No Node.js needed:
Windows PowerShell (Recommended):
irm https://claude.ai/install.ps1 | iex
macOS / Linux:
curl -fsSL https://claude.ai/install.sh | bash
Homebrew (macOS/Linux):
brew install --cask claude-code
Run claude --version to confirm. Success looks like: a version number prints without errors.
Step-by-Step: Install Claude Code on Any Platform
Before you install Claude Code, check that you have:
- Terminal access (Command Prompt, PowerShell, or Bash)
- An Anthropic API key from console.anthropic.com
- Node.js 18+ (only if you plan to install via npm)
Install Claude Code on Windows
Windows supports a few install paths. Pick the one that fits your workflow:
Option 1: Native Windows (Recommended)
# PowerShell (Run as Administrator)
irm https://claude.ai/install.ps1 | iex
claude --versionOption 2: Git Bash
Install Git for Windows, then:
curl -fsSL https://claude.ai/install.sh | bash
claude --versionOption 3: WSL (Ubuntu)
# Install WSL if needed (PowerShell as Administrator)
wsl --install -d Ubuntu
# Inside Ubuntu terminal
curl -fsSL https://claude.ai/install.sh | bash
claude --versionWindows users: the native installer no longer needs Node.js. On WSL, run Claude Code from your Linux terminal.
Install Claude Code on macOS
Option 1: Homebrew (Recommended)
brew install --cask claude-code
claude --versionOption 2: Native Installer
curl -fsSL https://claude.ai/install.sh | bash
claude --versionOption 3: npm (if you prefer Node.js)
npm install -g @anthropic-ai/claude-code
# If you see "command not found", fix PATH:
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
claude --versionInstall Claude Code on Linux
Option 1: Native Installer (Recommended)
curl -fsSL https://claude.ai/install.sh | bash
claude --versionOption 2: Homebrew
brew install --cask claude-code
claude --versionOption 3: npm (requires Node.js 18+)
# Create user npm directory (prevents sudo requirements)
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Install Claude Code
npm install -g @anthropic-ai/claude-code
claude --versionConfigure Your API Key
Once the install succeeds, set up authentication:
claude
# Paste your API key when promptedGet your API key: open console.anthropic.com, create an account, go to API Keys, and generate a new key starting with sk-.
Verify Your Installation
Test your Claude Code setup:
claude --version # Shows version number
claude doctor # Runs diagnosticsQuick functionality test:
mkdir test-project && cd test-project
echo "console.log('Hello!');" > test.js
claudeIn the Claude prompt: "Read test.js and explain it"
Success: Claude reads the file and explains the JavaScript.
Common Errors When You Install Claude Code
Error: "Command Not Found"
Cause: PATH configuration is missing after install
Fix:
which claude # Check if installed
npm list -g @anthropic-ai/claude-code
# Add to PATH manually
echo 'export PATH="$PATH:/usr/local/lib/node_modules/@anthropic-ai/claude-code/bin"' >> ~/.bashrc
source ~/.bashrcError: "EBADPLATFORM"
Cause: npm install ran on an unsupported platform config
Fix: use the native installer instead of npm:
# Windows PowerShell
irm https://claude.ai/install.ps1 | iexError: "EACCES Permission Denied"
Cause: npm wants sudo (not a safe habit)
Fix: set up a user-level npm directory (see the Linux section above). This works on every platform.
Nuclear Reset (Fixes 95% of Issues)
When nothing else works, reset the whole thing:
npm uninstall -g @anthropic-ai/claude-code
rm -rf ~/.claude ~/.npm/_cacache
npm cache clean --force
npm install -g @anthropic-ai/claude-code
claude --versionWhat to Do After You Install Claude Code
Once claude --version comes back clean:
- Build your first project: First Project Guide
- Learn the interface: What is Claude Code
- Configure settings: Configuration Basics
- Fix common problems: Troubleshooting Guide
- See real examples: Examples & Templates
Pro tip: run claude doctor any time something feels broken. It auto-detects most config issues and suggests fixes.
Stop configuring. Start building.
What Is Claude Code?
An agentic coding assistant that lives in your shell, reads your whole project, and runs commands with your approval. Here is how it works.
Claude Code Native Installer
A single command installs Claude Code on Windows, Mac, or Linux. Zero Node.js, zero npm, zero PATH fiddling. Auto-updates included.