Skip to content

安装与准备

Claude Code 支持多种安装方式,选择适合你的平台开始安装。

前置条件

确保系统已安装 Node.js 18+ 版本。

快速安装

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

TIP

原生安装会自动更新,Homebrew 和 npm 安装需要手动运行升级命令。

Windows 安装详细说明

前置条件

  • Windows 10 或 Windows 11
  • PowerShell 5.1 或更高版本
  • Node.js 18+(npm 安装方式需要)

方式一:原生安装(推荐)

以管理员身份打开 PowerShell,运行:

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

方式二:npm 安装

powershell
npm install -g @anthropic-ai/claude-code

验证安装

powershell
claude --version

常见问题

执行策略限制

如果遇到脚本执行策略限制,可以临时允许:

powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

路径问题

确保安装路径已添加到系统 PATH 环境变量中。

安装后

安装完成后,运行 claude 命令启动并完成认证。