本页只介绍 Claude Code 的安装、验证、更新和卸载。模型与 API 接入配置请查看项目中的“Claude 模型食用教程”。
https://nodejs.org/en/downloadhttps://docs.npmjs.com/downloading-and-installing-node-js-and-npm/node 或 npm,请先重新打开终端;仍然无效时,检查 Node.js 是否已加入系统 PATH。https://registry.npmjs.org/https://registry.npmjs.org/https://registry.npmmirror.com/不要继续使用旧地址 registry.npm.taobao.org。国内镜像请使用当前的https://registry.npmmirror.com。
@anthropic-ai/claude-codehttps://www.npmjs.com/package/@anthropic-ai/claude-codesudo:不要使用:sudo npm install -g @anthropic-ai/claude-codesudo 进行全局安装可能造成 npm 目录权限和后续自动更新问题。如果遇到权限错误,建议使用 nvm 管理 Node.js,而不是直接使用 sudo。https://git-scm.com/download/winbash.exe 路径:$env:CLAUDE_CODE_GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"