Skip to content

Step 1: Install Node.js

Claude Code requires Node.js to run.

Method 1: Download from official site (Recommended)

  1. Open your browser and visit https://nodejs.org
  2. Click the LTS version to download (recommended)
  3. Double-click the downloaded .msi file
  4. Follow the installation wizard with default settings

Method 2: Using a package manager

powershell
# Chocolatey
choco install nodejs

# Scoop
scoop install nodejs

NOTE

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:

bash
node --version
npm --version

If version numbers are displayed, the installation was successful.

Step 2: Install Claude Code

Open PowerShell or CMD and run the following command:

bash
npm install -g @anthropic-ai/claude-code

TIP

Verify Claude Code installation

bash
claude --version

If version numbers are displayed, the installation was successful.

Step 3: Set environment variables

Configure Claude Code environment variables

Method 1: PowerShell temporary (current session)

powershell
$env:ANTHROPIC_BASE_URL = "https://api.bsf.ai"
$env:ANTHROPIC_AUTH_TOKEN = "your_api_key"

Method 2: PowerShell permanent (user level)

powershell
[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

powershell
echo $env:ANTHROPIC_BASE_URL
echo $env:ANTHROPIC_AUTH_TOKEN

Step 4: Start using

Launch Claude Code

bash
claude

Use in a specific project

powershell
cd C:\path\to\your\project
claude

FAQ

Issue: PowerShell execution policy error

If you encounter script loading or execution policy errors, run as administrator:

powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Issue: claude command not found

If you see 'claude' is not recognized as a command:

  1. Confirm Claude Code is properly installed
  2. Confirm you have reopened the terminal window
  3. 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:

bash
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com