Files
claude/README-Windows.md
2026-01-10 07:23:09 +00:00

7.3 KiB

Claude Code Installer for Windows

A colorized, interactive PowerShell installer script that automates the installation of Claude Code on Windows systems.

License Platform Node PowerShell


Quick Install

One-line installation (Run in PowerShell as Administrator):

irm https://git.bitmaster.cc/BitMaster/claude/raw/branch/main/claude-code-installer.ps1 | iex

Or with full command:

Invoke-RestMethod https://git.bitmaster.cc/BitMaster/claude/raw/branch/main/claude-code-installer.ps1 | Invoke-Expression

⚠️ Note: You may need to run PowerShell as Administrator for the installation to complete successfully.


Manual Installation

Step 1: Download the installer script

Invoke-WebRequest -Uri "https://git.bitmaster.cc/BitMaster/claude/raw/branch/main/claude-code-installer.ps1" -OutFile "claude-code-installer.ps1"

Step 2: Allow script execution (if needed)

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Step 3: Run the installer

.\claude-code-installer.ps1

Features

🔍 System Detection

Feature Description
Windows Detection Identifies Windows version and build number
Architecture Detects x64, x86, or ARM64 for correct Node.js download
System Info Shows computer name, RAM, and PowerShell version
Admin Check Verifies if running with Administrator privileges

📦 Node.js Management

Feature Description
Version Check Checks if Node.js/npm are installed and their versions
Compatibility Detects if the version is compatible (v18+ required)
Clean Removal Uninstalls existing Node.js via Windows installer
Fresh Install Downloads and installs Node.js 20 LTS from nodejs.org
Verification Verifies installation after completion

🛡️ Permission Modes

When the installation completes, you'll be prompted to choose how Claude Code runs:

Mode Flag Description
1. Normal Mode (default) Asks before each operation — safest option
2. Auto-Accept Edits --auto-accept-edits Auto-accepts file changes, confirms commands
3. Full Auto Mode --dangerously-skip-permissions Skips all prompts — use with caution!
4. Exit Don't start Claude, just complete installation

System Requirements

Requirement Minimum
Operating System Windows 10 / Windows 11 / Windows Server 2016+
PowerShell Version 5.1 or later
Architecture x64, x86, or ARM64
Permissions Administrator recommended
Internet Required for downloading packages

What Gets Installed

  1. Node.js 20 LTS — JavaScript runtime (if not already installed or outdated)
  2. npm — Node package manager (comes with Node.js)
  3. Claude Code — Anthropic's CLI tool for AI-assisted coding

Installation Paths

Component Default Location
Node.js C:\Program Files\nodejs\
npm global packages %APPDATA%\npm\
npm cache %APPDATA%\npm-cache\
Claude Code %APPDATA%\npm\claude.cmd

Post-Installation

After installation, you can start Claude Code anytime:

Command Prompt or PowerShell:

# Normal mode (recommended)
claude

# Auto-accept file edits
claude --auto-accept-edits

# Full auto mode (dangerous)
claude --dangerously-skip-permissions

If the claude command is not recognized, restart your terminal or open a new PowerShell/Command Prompt window.


Troubleshooting

"claude" is not recognized

Solution 1: Restart your terminal (PowerShell/Command Prompt)

Solution 2: Refresh environment variables

$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")

Solution 3: Manually add npm to PATH

$env:Path += ";$env:APPDATA\npm"

Execution Policy Error

If you see "cannot be loaded because running scripts is disabled":

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Permission Denied / Access Denied

Run PowerShell as Administrator:

  1. Right-click on PowerShell
  2. Select "Run as administrator"
  3. Run the installer again

Node.js Installation Fails

Option 1: Download and install manually from nodejs.org

Option 2: Use winget (Windows Package Manager):

winget install OpenJS.NodeJS.LTS

Option 3: Use Chocolatey:

choco install nodejs-lts

npm Install Fails

Clear npm cache and retry:

npm cache clean --force
npm install -g @anthropic-ai/claude-code

Uninstallation

Remove Claude Code

npm uninstall -g @anthropic-ai/claude-code

Remove Node.js

Option 1: Via Windows Settings

  1. Open Settings → Apps → Installed apps
  2. Search for "Node.js"
  3. Click Uninstall

Option 2: Via Control Panel

  1. Open Control Panel → Programs → Uninstall a program
  2. Find "Node.js"
  3. Click Uninstall

Option 3: Via PowerShell

# Find and uninstall Node.js
Get-Package -Name "*Node*" | Uninstall-Package

Clean Up Remaining Files

# Remove npm cache and global packages
Remove-Item -Recurse -Force "$env:APPDATA\npm" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "$env:APPDATA\npm-cache" -ErrorAction SilentlyContinue

Alternative Installation Methods

Using winget (Windows Package Manager)

# Install Node.js
winget install OpenJS.NodeJS.LTS

# Install Claude Code
npm install -g @anthropic-ai/claude-code

Using Chocolatey

# Install Chocolatey (if not installed)
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Install Node.js
choco install nodejs-lts

# Install Claude Code
npm install -g @anthropic-ai/claude-code

Using Scoop

# Install Scoop (if not installed)
irm get.scoop.sh | iex

# Install Node.js
scoop install nodejs-lts

# Install Claude Code
npm install -g @anthropic-ai/claude-code

License

This installer script is provided under the MIT License.

Claude Code is a product of Anthropic.



Contributing

Issues and pull requests are welcome at:

https://git.bitmaster.cc/BitMaster/claude


Made with ❤️ for the Claude community