Claude Code 国内安装方法
nodejs安装
nodejs下载地址:https://nodejs.org/zh-cn/download
可参考文章:nodejs安装
通过npm安装是国内最快捷的,安装nodejs18版本以上
安装claude-code
安装claude-code
1
npm install -g @anthropic-ai/claude-code
验证安装
1
claude --version
跳过登录验证,否则会报错。编辑.claude.json 文件,添加
hasCompletedOnboarding参数;linux在用户目录下,windows也同样在用户目录下,对应的user下。1
"hasCompletedOnboarding": true
报错:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24Welcome to Claude Code v2.1.195
..........................................................
* █████▓▓░
* ███▓░ ░░
░░░░░░ ███▓░
░░░ ░░░░░░░░░░ ███▓░
░░░░░░░░░░░░░░░░░░░ * ██▓░░ ▓
░▓▓███▓▓░
* ░░░░
░░░░░░░░
░░░░░░░░░░░░░░░░
█████████ *
██▄█████▄██ *
█████████ *
.......█ █ █ █..........................................
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ERR_BAD_REQUEST
Please check your internet connection and network settings.
Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countries
最后配置api即可使用,参考对应api厂商api接口文档。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 HAHA!


