环境要求

  • 操作系统:macOS 10.15+ / Ubuntu 18.04+ / Windows 10+
  • Node.js:版本 18.0.0 及以上
  • npm:版本 8.0.0 及以上

通过npm全局安装

# 检查 Node.js 版本
node --version

# 全局安装 Claude Code
npm install -g @anthropic-ai/claude-code

# 验证安装是否成功
claude --version

常见安装问题

网络问题问题可以尝试设置

# 设置 npm 镜像源
npm config set registry https://registry.npmmirror.com
npm install -g @anthropic-ai/claude-code

获取API-key

对应平台获取key

claude code配置

先使用cd命令或者进入 C:/User/当前用户/.claude

cd C:/User/当前用户/.claude

然后输入code.

code .

打开编辑此时新settings.json文件添加如下内容

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-J2pxxxxxxxxxxxxxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
    "ANTHROPIC_MODEL": "glm-4.5"
  }
}

参考:

详细教程:https://mp.weixin.qq.com/s/9FpoOFcFEKf_p72TnzEh8w

指令查找:https://mp.weixin.qq.com/s/hZBsOftFcT6-FUC2cnZA7Q


更多资讯,欢迎关注微信公众号"码农闲聊室"

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐