Installation
Install and configure Claude Code on Windows, macOS, and Linux
Installation¶
Follow this guide to easily install and use Claude Code on your computer. The entire process takes just 5 minutes.
Prerequisites¶
Claude Code requires Node.js to run. Please ensure you have Node.js 18.0 or higher installed on your computer.
Windows¶
Step 1: Install Node.js¶
Option A: Official Download (Recommended)¶
- Open your browser and visit https://nodejs.org/
- Click the "LTS" version download (recommended Long Term Support version)
- Double-click the downloaded
.msifile - Follow the installation wizard using default settings
Option B: Using Package Manager¶
If you have Chocolatey or Scoop installed:
# Using Chocolatey
choco install nodejs
# Or using Scoop
scoop install nodejs
Verify Installation¶
node --version
npm --version
Step 2: Install Claude Code¶
Open PowerShell or CMD:
npm install -g @anthropic-ai/claude-code
Verify installation:
claude --version
Step 3: Set Environment Variables¶
Temporary (Current Session)¶
$env:ANTHROPIC_BASE_URL = "https://asia.qcode.cc/api"
$env:ANTHROPIC_AUTH_TOKEN = "your-api-key"
Permanent (Recommended)¶
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://asia.qcode.cc/api", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your-api-key", [System.EnvironmentVariableTarget]::User)
Replace
your-api-keywith your actual key from QCode.cc Dashboard.
Step 4: Start Using¶
cd C:\path\to\your\project
claude
macOS¶
Step 1: Install Node.js¶
Option A: Using Homebrew (Recommended)¶
brew update
brew install node
Option B: Official Download¶
- Visit https://nodejs.org/
- Download the macOS LTS version
- Open the downloaded
.pkgfile - Follow the installation instructions
Verify Installation¶
node --version
npm --version
Step 2: Install Claude Code¶
npm install -g @anthropic-ai/claude-code
If you encounter permission issues:
sudo npm install -g @anthropic-ai/claude-code
Step 3: Set Environment Variables¶
Permanent (Recommended)¶
# For zsh (macOS default)
echo 'export ANTHROPIC_BASE_URL="https://asia.qcode.cc/api"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="your-api-key"' >> ~/.zshrc
source ~/.zshrc
Step 4: Start Using¶
cd /path/to/your/project
claude
Linux / WSL2¶
Step 1: Install Node.js¶
Option A: Using NodeSource (Recommended)¶
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
Option B: Using System Package Manager¶
# Ubuntu/Debian
sudo apt update
sudo apt install nodejs npm
# CentOS/RHEL/Fedora
sudo dnf install nodejs npm
Step 2: Install Claude Code¶
npm install -g @anthropic-ai/claude-code
Step 3: Set Environment Variables¶
echo 'export ANTHROPIC_BASE_URL="https://asia.qcode.cc/api"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="your-api-key"' >> ~/.bashrc
source ~/.bashrc
Step 4: Start Using¶
cd /path/to/your/project
claude
Next Steps¶
Congratulations! You've successfully installed Claude Code. Next:
- Check out Quick Start to learn basic usage
- Learn about Environment Variables for customization
- Explore Usage Tips to boost efficiency