---
# System prepended metadata

title: '[Claude Code 001] Windows 11 安裝 Claude Code 教學'

---

## 🔶 [Claude Code 001] Windows 11 安裝 Claude Code 教學

###### 📅 2026-05-18

> 建議做法
> Windows 11 直接用官方 Native / WinGet 安裝
>
> 若要搭配 Linux 開發環境
> 再用 **WSL2 + Ubuntu**

Claude Code 官方目前支援：

- Terminal CLI
- VS Code
- Desktop
- Web

Windows 可用：

- PowerShell
- CMD
- WinGet

WSL 也可使用 Linux 安裝方式

---

## 方式 A：Windows 11 原生安裝

### 1. 開啟 PowerShell

使用一般 PowerShell 即可

```powershell
irm https://claude.ai/install.ps1 | iex
```

---

### 2. 確認安裝

```powershell
claude --version
```

---

### 3. 進入專案資料夾

```powershell
cd "C:\專案路徑"
claude
```

第一次啟動時會要求登入 Claude 帳號

---

### 4. 建議安裝 Git for Windows

官方建議 Windows Native 環境安裝：

- Git for Windows

用途：

- 讓 Claude Code 可使用 Bash Tool
- 若未安裝則改用 PowerShell

---

## 方式 B：使用 WinGet 安裝

### 安裝

```powershell
winget install Anthropic.ClaudeCode
```

---

### 更新

```powershell
winget upgrade Anthropic.ClaudeCode
```

---

### 補充

WinGet 版本不會自動更新

需定期手動 upgrade

---

## 方式 C：WSL2 + Ubuntu 安裝

適合：

- Node.js
- Python
- Docker
- Linux 開發環境
- Backend 開發

---

### 1. 安裝 WSL Ubuntu

PowerShell 系統管理員：

```powershell
wsl --install -d Ubuntu
```

---

### 2. 重開機後初始化 Ubuntu

流程：

- 開 Ubuntu
- 建立 Linux 使用者
- 設定密碼

---

### 3. 確認 WSL 版本

```powershell
wsl -l -v
```

建議看到：

```text
Ubuntu    Running    2
```

---

### 4. 若不是 WSL2

```powershell
wsl --set-version Ubuntu 2
```

---

### 5. 在 Ubuntu 安裝 Claude Code

進入 Ubuntu Terminal：

```bash
curl -fsSL https://claude.ai/install.sh | bash
```

---

### 6. 確認安裝

```bash
claude --version
```

---

### 7. 啟動 Claude Code

```bash
cd ~/your-project
claude
```

---

## VS Code 搭配方式

### 安裝 Extension

```powershell
code --install-extension anthropic.claude-code
```

---

### 或從 VS Code 安裝

流程：

1. 開 VS Code
2. Extensions
3. 搜尋：

```text
Claude Code
```

4. 安裝

---

### 啟動方式

快捷鍵：

```text
Ctrl + Shift + P
```

搜尋：

```text
Claude Code
```

即可啟動

---

## 常見錯誤

## 1. PowerShell / CMD 指令混用

### PowerShell

```powershell
irm https://claude.ai/install.ps1 | iex
```

---

### CMD

```cmd
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
```

---

## 2. WSL 卡住

若：

```powershell
wsl -l -v
```

卡住

---

### 關閉 WSL

```powershell
wsl --shutdown
```

---

### 重啟 LxssManager

```powershell
net stop LxssManager
net start LxssManager
```

---

### 若 Docker 干擾

先完全關閉 Docker Desktop

---

## 3. Docker + WSL 衝突

若 Docker Desktop 開啟後：

```powershell
wsl -l -v
```

卡住

建議：

1. 更新 WSL

```powershell
wsl --update
```

2. 重開機

3. 再開 Docker Desktop

---

## 建議開發環境

### 基本版 一般使用者

- Windows 11
- PowerShell
- VS Code
- Claude Code Native

---

### 開發者版

- Windows 11
- WSL2 Ubuntu
- VS Code
- Docker Desktop
- Git
- Claude Code

---

## 官方連結

### Claude Code 官方

https://code.claude.com/docs/en/overview

---

### Git for Windows

https://git-scm.com/download/win

---

### WSL 官方

https://learn.microsoft.com/windows/wsl/install

---

### Docker Desktop

https://www.docker.com/products/docker-desktop/

---

## 最短安裝版

### Windows Native

```powershell
irm https://claude.ai/install.ps1 | iex
claude --version
claude
```

---

### WSL Ubuntu

```bash
curl -fsSL https://claude.ai/install.sh | bash
claude --version
claude
```
