40>40>
41> **macOS、Linux、WSL:**41> **macOS、Linux、WSL:**
42>42>
43> ```bash theme={null}43> ```bash theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}
44> curl -fsSL https://claude.ai/install.sh | bash44> curl -fsSL https://claude.ai/install.sh | bash
45> ```45> ```
46>46>
48>48>
49> **Windows PowerShell:**49> **Windows PowerShell:**
50>50>
51> ```powershell theme={null}51> ```powershell theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}
52> irm https://claude.ai/install.ps1 | iex52> irm https://claude.ai/install.ps1 | iex
53> ```53> ```
54>54>
55> **Windows CMD:**55> **Windows CMD:**
56>56>
57> ```batch theme={null}57> ```batch theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}
58> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd58> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
59> ```59> ```
60>60>
72 72
73> [tab] Homebrew73> [tab] Homebrew
74>74>
75> ```bash theme={null}75> ```bash theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}
76> brew install --cask claude-code76> brew install --cask claude-code
77> ```77> ```
78>78>
84 84
85> [tab] WinGet85> [tab] WinGet
86>86>
87> ```powershell theme={null}87> ```powershell theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}
88> winget install Anthropic.ClaudeCode88> winget install Anthropic.ClaudeCode
89> ```89> ```
90>90>
141 141
142### Alpine Linux 和 musl 型發行版142### Alpine Linux 和 musl 型發行版
143 143
144在 Alpine 和其他 musl/uClibc 型發行版上安裝 Claude Code 需要 `bash` 和 `curl` 用於安裝命令,以及 `libgcc`、`libstdc++` 和 `ripgrep` 用於執行時。Alpine 預設不包含 `bash` 或 `curl`,因此在您安裝它們之前,文件中的安裝命令會失敗並出現 `not found` 錯誤。使用您的發行版套件管理員安裝這些套件,然後設定 `USE_BUILTIN_RIPGREP=0`。144在 Alpine 和其他 musl 型發行版上,[安裝命令](#install-claude-code)需要 `bash` 和 `curl`,而 Claude Code 本身需要 `bash` 或 `zsh`。Alpine 預設不包含 `bash` 或 `curl`,因此在您安裝它們之前,文件中的安裝命令會失敗並出現 `not found` 錯誤。
145 145
146此範例在 Alpine 上安裝所需的套件:146此範例在 Alpine 上安裝所需的套件:
147 147
148```bash theme={null}148```bash theme={null}
149apk add bash curl libgcc libstdc++ ripgrep149apk add bash curl
150```
151
152在 Alpine 上,`ripgrep` 位於社群儲存庫中。如果 `apk` 報告套件遺失,請將社群儲存庫新增至 `/etc/apk/repositories`,使用您的 Alpine 版本:
153
154```bash theme={null}
155echo "https://dl-cdn.alpinelinux.org/alpine/v3.22/community" >> /etc/apk/repositories
156```
157
158執行 `apk update` 以重新整理套件索引,然後重試 `apk add` 命令。
159
160然後在您的 [`settings.json`](https://code.claude.com/docs/zh-TW/settings-reference#all-settings) 檔案中將 `USE_BUILTIN_RIPGREP` 設定為 `0`:
161
162```json theme={null}
163{
164 "env": {
165 "USE_BUILTIN_RIPGREP": "0"
166 }
167}
168```150```
169 151
170## 驗證您的安裝152## 驗證您的安裝
443> wget -O /etc/apk/keys/claude-code.rsa.pub \425> wget -O /etc/apk/keys/claude-code.rsa.pub \
444> https://downloads.claude.ai/keys/claude-code.rsa.pub426> https://downloads.claude.ai/keys/claude-code.rsa.pub
445> echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories427> echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories
446> apk add claude-code428> apk add bash claude-code
447> ```429> ```
448>430>
449> 若要切換至 `latest` 通道,移除 `stable` 儲存庫行並新增 `latest` 儲存庫:431> 若要切換至 `latest` 通道,移除 `stable` 儲存庫行並新增 `latest` 儲存庫: