← 返回首页ai798LAB Public

vibe-coding-课程-干货集训

02 如何安装&配置Claude Code

2025年12月18日1. 在编程工具中使用Claude Code插件

Claude Code在哪使用

插件(首推)

  1. 在编程工具中使用Claude Code插件 Claude Code for Cursor Claude Code for VSCode
  2. 新手推荐指数
  3. 🌟🌟🌟🌟🌟
  4. 优势
  1. 和工具对话进行编程,对小白很友好
  2. 可以同时多开很多个窗口,像浏览器多开N个页面,让Claude Code在不同窗口帮你完成不同任务
  3. 可以同步使用其他的工具或插件功能,灵活度高
  1. 劣势

Claude Code插件更新可能没那么快,一些新能力或新模型会最新应用在Claude Code CLI上

CLI

  1. 在电脑本地终端使用Claude Code
  2. 新手推荐指数
  3. 🌟🌟🌟🌟
  4. 优势
  1. 编码速度快
  2. 功能完整,更新最快
  1. 劣势

需要熟悉一些基础命令行,对纯小白有一定学习成本

Web

  1. 在浏览器使用Claude Code
  2. 传送门:https://claude.ai/code
  3. 新手推荐指数
  4. 🌟🌟🌟
  5. 优势
  1. 无需安装
  2. 清晰的使用界面,0上手门槛
  1. 劣势

无法操作本地文件,扩展性弱

安装Claude Code插件(以Cursor为例)

Step 1 · 下载Cursor

  1. 下载并安装
  2. Cursor:https://cursor.com/![](https://ai798picvid.oss-cn-beijing.aliyuncs.com/kb-assets/lab/UnxQdh4CioagS1xRh2qcDfx5nuf/ItrubESpBoMF71x15Qkc0ijVnJe.png)
  3. VScode(Visual Studio Code):https://code.visualstudio.com/download

Step 2 · 下载Claude Code插件

  1. 打开Cursor,进入「插件」面板,搜索“Claude Code”并下载

Step 3 · 登录Claude Code

  1. 安装完成后,点击"..." - 「」
  2. 进入Claude Code对话页面
  3. 点击「Claude.ai Subscription」,打开网页进行授权
  4. 授权成功,回到Cursor就能开始使用Claude Code了

安装Claude Code CLI

MacOS

Step 1 · 安装Node.js
  1. 打开终端:Command + 空格 ➡️ 输入“Terminal”(即终端) ➡️ 打开终端
  2. 在终端里输入指令,检测是否安装Node.js
  3. 已安装Node.js,会出现
  4. 未安装Node.js,先前往官网下载 1. 下载地址:https://nodejs.org 1. 下载并安装成功后,打开终端,输入命令,验证安装成功 ``` node -v # 应该显示 v20.x.x 或 v22.x.x npm -v # 应该显示 10.x.x

node -v


##### Step 2 · 安装Claude Code

1. 在终端输入以下命令
  1. 如果你的网络很慢,关掉vpn,在终端内先用键盘的“Control + C”停掉进程,再输入以下指令,使用国内镜像安装

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

npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com

2. 如果安装成功,会出现这样的结果

changed 16 packages in 4s2 packages are looking for funding run npm fund for details


##### Step 3 · 登录Claude Code

1. 验证当前安装是否成功,在终端输入指令,看到版本号就说明安装成功

claude --version

2. 确定安装成功后,输入指令
  1. 应该可以看到,Claude让你做授权的选项,点击回车键![](https://ai798picvid.oss-cn-beijing.aliyuncs.com/kb-assets/lab/UnxQdh4CioagS1xRh2qcDfx5nuf/QZopbYWOJoUz4RxmqaqciHarnfc.png)
  2. 我们就能看到,启动Claude Code CLI成功的画面。即可开始使用![](https://ai798picvid.oss-cn-beijing.aliyuncs.com/kb-assets/lab/UnxQdh4CioagS1xRh2qcDfx5nuf/TZogbuDh4oxkXbxgSWfcCmf4n6f.png)

claude


#### Windows![](https://ai798picvid.oss-cn-beijing.aliyuncs.com/kb-assets/lab/UnxQdh4CioagS1xRh2qcDfx5nuf/AZDobitzxos0xFxY0sQcoYr6nth.png)

##### Step 1 · 确认系统自带Powershell

1. Windows 10(版本1903及以上)自带Powershell,更早的系统版本请先更新Windows系统

##### Step 2 · 打开Powershell

1. 右键点击开始菜单 → 选择"Windows PowerShell"

##### Step 3 · 使用winget方式安装Node.js

1. 输入指令

winget install OpenJS.NodeJS.LTS

2. 出现如下结果

Found Node.js LTS [OpenJS.NodeJS.LTS] Version x.x.x Starting package install... Successfully installed

3. 验证Node.js安装结果,输入指令

node -v**预期结果**v20.x.x 或 v22.x.x


##### Step 4 · 安装Claude Code

1. 在Powershell中输入指令
  1. 如果速度很慢,请使用国内镜像

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

npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com```**预期结果**```added 16 packages in 4s

2. 安装成功后,验证一下,在Powershell中输入

claude --version**预期结果**claude version x.x.x(如 1.0.40)


##### Step5 · 启动Claude Code

1. 在Powershell中输入指令
  1. 打开对应页面进行授权即可
  2. 完成授权后,回到Powershell,如果显示如下👇,则启动成功。即可开始使用

claude **预期结果** 终端显示: To authenticate, visit: https://console.anthropic.com/...

Successfully authenticated as: xxx@xxx.com