docs: update README installation instructions

- Recommend official install script over npm
- Pin npm fallback to 2.1.118 due to Kimi compatibility
- Update Windows install notes and first-run auth hint
This commit is contained in:
Zhengshou Lai
2026-06-13 09:21:08 +08:00
parent 0c31cffeda
commit c9fd2321ed
+13 -7
View File
@@ -38,31 +38,37 @@ myclaude/
**macOS/Linux:**
```bash
# 推荐:官方安装脚本
curl -fsSL https://claude.ai/install.sh | sh
# 或使用 npm: npm install -g @anthropic-ai/claude-code
# 备选:npmHomebrew 不可用时,固定 2.1.118,新版本有 Kimi 兼容问题)
npm install -g @anthropic-ai/claude-code@2.1.118
```
> ⚠️ **npm 安装已弃用**`npm install -g @anthropic-ai/claude-code` 从 2026-01-21v2.1.15)起已被 Anthropic 官方弃用,未来版本可能失效。请优先使用官方安装脚本。
**Windows:**
```powershell
# 推荐:官方安装脚本
irm https://claude.ai/install.ps1 | iex
# 或: winget install Anthropic.ClaudeCode
# 或 winget
winget install Anthropic.ClaudeCode
```
> **注意**Windows 用户需先安装 [Git for Windows](https://git-scm.com/download/win)
>
> **💡 认证提示**:运行 `claude login` 后,建议选择 **方案 2 (API Key)**,但将 API Token 留空。这样 Claude 会使用 cc-switch 的配置,方便后续通过 cc-switch 切换不同模型。
> **💡 认证提示**首次运行 Claude Code 时,建议选择 **方案 2 (API Key)**,但将 API Token 留空。这样 Claude 会使用 cc-switch 的配置,方便后续通过 cc-switch 切换不同模型。
>
> **来源**[Claude Code 官方文档](https://code.claude.com/docs/en/quickstart)
安装完成后,首次使用需登录
安装完成后验证
```bash
claude login
claude --version
```
> 💡 建议选择 **方案 2 (API Key)**,但将 API Token 留空,这样 Claude 会使用 cc-switch 的配置。
### 2. 开通大模型会员(推荐)
| 服务 | 说明 | 开通地址 |