是什么
setup 页面覆盖 Claude Code 的系统要求、多平台安装方式、版本管理和卸载流程。适用于需要在特定环境中精确控制安装的场景,日常用户参考 quickstart 即可。
核心机制
系统要求
- OS:macOS 13+、Windows 10 1809+/Server 2019+、Ubuntu 20.04+、Debian 10+、Alpine 3.19+
- 硬件:4 GB+ RAM,x64 或 ARM64
- Shell:Bash、Zsh、PowerShell、CMD
- Windows 推荐安装 Git for Windows(提供 Bash 工具支持)
安装方式
| 方式 | 命令 | 特点 |
|---|---|---|
| Native(推荐) | curl -fsSL https://claude.ai/install.sh | bash | 自动后台更新 |
| Homebrew | brew install --cask claude-code | macOS 包管理 |
| npm | npm install -g @anthropic-ai/claude-code | 跨平台,需 Node.js |
| Desktop App | 图形界面安装包 | 无需终端 |
Windows PowerShell:irm https://claude.ai/install.ps1 | iex
版本管理
- Native 安装:自动后台更新
- npm 安装:
npm update -g @anthropic-ai/claude-code - 手动更新:
claude update - 查看版本:
claude --version
卸载
- macOS/Linux:
claude uninstall - npm:
npm uninstall -g @anthropic-ai/claude-code - Desktop App:标准应用卸载流程
关键细节
- WSL 不需要 Git for Windows,WSL 内直接使用 Linux 安装方式
- PowerShell 提示符以
PS C:\开头,CMD 以C:\开头(无 PS 前缀) - ripgrep 通常随 Claude Code 一起安装,搜索失败时检查 troubleshooting
CLAUDE_CONFIG_DIR环境变量可自定义配置目录位置
与其他概念的关联
- authentication - 安装后的登录配置
- network-config - 企业网络环境的代理和防火墙配置
- admin-setup - 组织级部署决策
实践要点
- 企业批量部署推荐 npm 或 Native 安装配合 MDM 分发
- 容器/CI 环境使用 npm 安装更易集成
- 安装后首次运行
claude会触发浏览器登录流程