高级设置
一句话
Claude Code 系统要求、平台特定安装、版本管理和卸载指南。
什么时候翻这页
- 需要了解 Claude Code 的系统要求和兼容性
- 安装过程中遇到问题
- 需要更新或卸载 Claude Code
- 想要使用特定版本或安装方式
核心概念
- 系统要求:Claude Code 支持 macOS 13.0+、Windows 10 1809+、Ubuntu 20.04+、Debian 10+ 和 Alpine Linux 3.19+,需要 4GB+ RAM 和网络连接
- 安装方式:原生安装(推荐)、Homebrew、WinGet、Linux 包管理器或 npm
- 版本管理:支持自动更新、手动更新、版本固定和发布渠道配置
- 认证:需要 Pro、Max、Team、Enterprise 或 Console 账户,免费版不包含 Claude Code 访问权限
怎么做
安装 Claude Code
-
原生安装(推荐):
- macOS/Linux/WSL:
curl -fsSL https://claude.ai/install.sh | bash - Windows PowerShell:
irm https://claude.ai/install.ps1 | iex - Windows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
- macOS/Linux/WSL:
-
其他安装方式:
- Homebrew:
brew install --cask claude-code(稳定版)或brew install --cask claude-code@latest(最新版) - WinGet:
winget install Anthropic.ClaudeCode - Linux 包管理器:按照特定步骤添加 apt/dnf/apk 仓库
- npm:
npm install -g @anthropic-ai/claude-code
- Homebrew:
-
验证安装:
claude --version检查版本claude doctor进行详细检查
更新 Claude Code
- 自动更新:原生安装默认自动更新,可通过
autoUpdatesChannel配置发布渠道 - 手动更新:运行
claude update - 禁用自动更新:在 settings.json 中设置
DISABLE_AUTOUPDATER: "1"
卸载 Claude Code
- 原生安装:删除
~/.local/bin/claude和~/.local/share/claude - Homebrew:
brew uninstall --cask claude-code或brew uninstall --cask claude-code@latest - WinGet:
winget uninstall Anthropic.ClaudeCode - Linux 包管理器:使用相应的 remove 命令并删除仓库配置
- npm:
npm uninstall -g @anthropic-ai/claude-code - 配置文件:删除
~/.claude、~/.claude.json和项目中的.claude、.mcp.json
命令 / 配置速查
| 命令/配置 | 说明 |
|---|---|
claude --version | 检查 Claude Code 版本 |
claude doctor | 诊断安装和配置问题 |
claude update | 手动更新 Claude Code |
autoUpdatesChannel | 配置自动更新渠道("latest" 或 "stable") |
minimumVersion | 设置最低版本要求 |
DISABLE_AUTOUPDATER | 禁用自动更新(设置为 "1") |
USE_BUILTIN_RIPGREP | 在 Alpine Linux 上设置为 "0" 以使用系统 ripgrep |
初学者易错点
- Windows 用户混淆 PowerShell 和 CMD,导致使用错误的安装命令
- 忘记安装 Git for Windows 时,Claude Code 会使用 PowerShell 而非 Bash
- Alpine Linux 需要额外安装 libgcc、libstdc++ 和 ripgrep 并设置
USE_BUILTIN_RIPGREP=0 - 使用 npm 安装时不应使用 sudo,可能导致权限问题
- 卸载时未删除配置文件,导致下次安装时保留旧设置
相关词条
quickstart快速入门指南terminal-guide终端使用指南authentication认证设置troubleshoot-install安装故障排除settings配置选项sandboxing沙箱功能