Step 1: Install Node.js
Claude Code requires Node.js to run.
Method 1: Download from official site (Recommended)
- Open your browser and visit https://nodejs.org
- Click the LTS version to download (recommended)
- Double-click the downloaded .msi file
- Follow the installation wizard with default settings
Method 2: Using a package manager
# Chocolatey
choco install nodejs
# Scoop
scoop install nodejsNOTE
Windows Notes
- PowerShell is recommended over CMD
- If you encounter permission issues, try running as administrator
TIP
Verify installation After installation, open a terminal and run the following commands:
node --version
npm --versionIf version numbers are displayed, the installation was successful.
Step 2: Install Claude Code
Open PowerShell or CMD and run the following command:
npm install -g @anthropic-ai/claude-codeTIP
Verify Claude Code installation
claude --versionIf version numbers are displayed, the installation was successful.
Step 3: Set environment variables
Configure Claude Code environment variables
Method 1: PowerShell temporary (current session)
$env:ANTHROPIC_BASE_URL = "https://api.bsf.ai"
$env:ANTHROPIC_AUTH_TOKEN = "your_api_key"Method 2: PowerShell permanent (user level)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.bsf.ai", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your_api_key", [System.EnvironmentVariableTarget]::User)You need to reopen the PowerShell window for changes to take effect.
TIP
Verify environment variables
echo $env:ANTHROPIC_BASE_URL
echo $env:ANTHROPIC_AUTH_TOKENStep 4: Start using
Launch Claude Code
claudeUse in a specific project
cd C:\path\to\your\project
claudeFAQ
Issue: PowerShell execution policy error
If you encounter script loading or execution policy errors, run as administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserIssue: claude command not found
If you see 'claude' is not recognized as a command:
- Confirm Claude Code is properly installed
- Confirm you have reopened the terminal window
- Check if the npm global install path is in PATH: npm config get prefix
Issue: Slow npm installation
You can use a mirror to speed up installation:
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com