Windows Installation Guide
Follow this tutorial to easily install and use Claude Code on your Windows PC.
We offer two installation methods:
Fully automated, great for beginners, completes in 5 minutes
⚡Method 1: One-click Script InstallationFull control over the installation process, suited for experienced users
🛠️Method 2: Manual InstallationMethod 1: One-click Script Installation (Recommended)
Use our one-click installation script to quickly complete all configuration.
Run the Installation Script
- Run PowerShell as Administrator
- Execute the following command:
irm https://academy.claude-code.club/assets/getting-started/installation/claude-code-installation-by-cc-club.ps1 | iexThe script will automatically perform the following actions:
- Detect and install Git Bash (if not installed)
- Detect and install Node.js (if not installed)
- Install Claude Code
- Configure environment variables
Important: You will need to enter your ANTHROPIC_AUTH_TOKEN (API key) during installation, so have it ready in advance.
Note: The tutorial is not over yet, the tutorial is not over yet, the tutorial is not over yet — you must complete the “Next Step”: Verify and Use.
Method 2: Manual Installation
If you prefer full control over the installation process, follow the steps below to install manually.
1. Install Node.js
Claude Code requires a Node.js environment to run.
Windows Installation Methods
Method 1: Download from the official website (Recommended)
- Open a browser and go to https://nodejs.org/
- Click the “LTS” version to download (the long-term support version is recommended)
- After downloading, double-click the .msi file
- Follow the installation wizard to complete the installation, keeping the default settings
Method 2: Use a package manager
If you have Chocolatey or Scoop installed, you can install via the command line:
# Using Chocolatey
choco install nodejs
# Or using Scoop
scoop install nodejsWindows Notes
- It is recommended to use PowerShell rather than CMD
- If you encounter permission issues, try running as Administrator
- Some antivirus software may give a false positive; you may need to add an exception
Verify the Installation
After installation, open PowerShell or CMD and enter the following commands:
node --version
npm --versionIf version numbers are displayed, the installation was successful!
2. Install Claude Code
Install Claude Code
Open PowerShell or CMD and run the following command:
# Install Claude Code globally
npm install -g @anthropic-ai/claude-codeThis command downloads and installs the latest version of Claude Code from the official npm registry.
Tips
- It is recommended to use PowerShell rather than CMD for its more powerful features
- “permission denied” error during installation: Run PowerShell or CMD as Administrator
- PowerShell execution policy error: If you encounter an execution policy restriction, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Verify the Claude Code Installation
After installation, enter the following command to check if it was installed successfully:
claude --versionIf a version number is displayed, congratulations! Claude Code has been successfully installed.
3. Set Environment Variables
Configure Claude Code Environment Variables
To connect Claude Code to your relay service, you need to set two environment variables.
Run the following commands in PowerShell to set user-level environment variables (execute one at a time):
# Set user-level environment variables (permanent)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://claude-code.club/api", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your-api-key", "User")
[System.Environment]::SetEnvironmentVariable("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "1", "User")Remember to replace “your-api-key” with the actual key you created in the “API Keys” tab above. You need to reopen the PowerShell window for the changes to take effect.
About CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
This environment variable disables non-essential network requests from Claude Code (such as telemetry reporting). When set to 1:
- Disables anonymous usage statistics and telemetry reporting
- Avoids connection timeouts or slowdowns caused by inability to reach telemetry servers (such as
sentry.io,statsig.com, etc.) - Does not affect the core functionality of Claude Code — it only disables background data collection
All users in China are recommended to configure this option, as it can significantly improve the experience.
After setting, use the following commands to verify the environment variables were set successfully (execute one at a time):
# View the set environment variables
[System.Environment]::GetEnvironmentVariable("ANTHROPIC_BASE_URL", "User")
[System.Environment]::GetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "User")
[System.Environment]::GetEnvironmentVariable("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "User")VSCode Claude Extension Configuration
If you use the Claude extension for VSCode, you need to configure the settings file:
Config file location: C:\Users\<your-username>\.claude\config.json
If the file does not exist, create it manually.
{
"primaryApiKey": "crs"
}Verify the config file was set correctly:
cat ~\.claude\config.jsonVerify Environment Variables
After setting the environment variables, you can verify them with the following commands:
Verify in PowerShell:
echo $env:ANTHROPIC_BASE_URL
echo $env:ANTHROPIC_AUTH_TOKENVerify in CMD:
echo %ANTHROPIC_BASE_URL%
echo %ANTHROPIC_AUTH_TOKEN%Expected output example:
https://claude-code.club/api
cr_xxxxxxxxxxxxxxxxxxIf the output is empty or displays the variable name itself, the environment variable was not set successfully. Please set it again.
Verify and Use
Verify the Installation
Important: You must restart PowerShell — you must restart PowerShell! This time do not run it as Administrator; just open it normally!
After installation is complete, reopen PowerShell and run:
claude --versionIf a version number is displayed, the installation was successful!
Start Using Claude Code
Now you can start using Claude Code!
Launch Claude Code
claudeUse in a Specific Project
# Navigate to your project directory
cd C:\path\to\your\project
# Launch Claude Code
claude🎉 Congratulations! You have successfully installed and configured Claude Code. You can now start enjoying the convenience of an AI coding assistant.
Next Steps
Learn the core features of Claude Code through hands-on practice
🚀Quick Start with Claude CodeExplore more practical tutorials and advanced tips
📚How to Do Things with Claude CodeWindows FAQ
SyntaxError: Unexpected token ’{’ Error
If you see an error like the following when running claude:
SyntaxError: Unexpected token '{'
at Loader.moduleStrategy (node:internal/modules/esm/translators:147:18)Cause: Node.js version is too old. Claude Code requires Node.js 18.x or higher.
Solution:
- Check the current version:
node --version - If the version is below v18, upgrade Node.js:
- Visit https://nodejs.org/ to download the latest LTS version
- Or use winget:
winget install OpenJS.NodeJS
- After upgrading, reopen PowerShell and verify:
node --version - Re-run the installation script or
npm install -g @anthropic-ai/claude-code
For detailed instructions, see: SyntaxError Fix
”permission denied” Error During Installation
Run PowerShell or CMD as Administrator.
PowerShell Execution Policy Error
If you encounter an execution policy restriction, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserEnvironment Variables Not Taking Effect After Setting
After setting permanent environment variables, you need to:
- Restart PowerShell or CMD
- Or log out and log back in to Windows
- Verify the setting:
echo $env:ANTHROPIC_BASE_URL
Need Help?
If you run into any tricky installation issues, scan the QR code below to join the Claude Code Club community group. There you can:
- Exchange AI programming experience and get answers from 3000+ excellent developers
- Get the latest Claude Code tips and tricks