J'Blog

3 课 · 入门

语义检索

基于 Chroma 向量库,与 Workspace 知识库分离。用自然语言描述你想查的内容。 非管理员每人每天可检索 5 次(消耗站点 AI 配额)。

高级设置

原文:Advanced setup

一句话

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

  1. 原生安装(推荐)

    • 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
  2. 其他安装方式

    • 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
  3. 验证安装

    • claude --version 检查版本
    • claude doctor 进行详细检查

更新 Claude Code

  • 自动更新:原生安装默认自动更新,可通过 autoUpdatesChannel 配置发布渠道
  • 手动更新:运行 claude update
  • 禁用自动更新:在 settings.json 中设置 DISABLE_AUTOUPDATER: "1"

卸载 Claude Code

  • 原生安装:删除 ~/.local/bin/claude~/.local/share/claude
  • Homebrewbrew uninstall --cask claude-codebrew uninstall --cask claude-code@latest
  • WinGetwinget uninstall Anthropic.ClaudeCode
  • Linux 包管理器:使用相应的 remove 命令并删除仓库配置
  • npmnpm 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

初学者易错点

  1. Windows 用户混淆 PowerShell 和 CMD,导致使用错误的安装命令
  2. 忘记安装 Git for Windows 时,Claude Code 会使用 PowerShell 而非 Bash
  3. Alpine Linux 需要额外安装 libgcc、libstdc++ 和 ripgrep 并设置 USE_BUILTIN_RIPGREP=0
  4. 使用 npm 安装时不应使用 sudo,可能导致权限问题
  5. 卸载时未删除配置文件,导致下次安装时保留旧设置

相关词条

  • quickstart 快速入门指南
  • terminal-guide 终端使用指南
  • authentication 认证设置
  • troubleshoot-install 安装故障排除
  • settings 配置选项
  • sandboxing 沙箱功能

官方原文:https://code.claude.com/docs/en/setup