[{"data":1,"prerenderedAt":329},["ShallowReactive",2],{"content:\u002Fposts\u002F54cd2e3":3,"surround:\u002Fposts\u002F54cd2e3":324},{"id":4,"title":5,"body":6,"categories":299,"date":301,"description":302,"donation":303,"draft":304,"extension":305,"image":306,"meta":307,"navigation":303,"path":309,"permalink":309,"published":306,"readingTime":310,"recommend":306,"references":306,"seo":315,"sitemap":316,"stem":317,"tags":318,"type":321,"updated":322,"__hash__":323},"content\u002Fposts\u002F2026\u002Fclaudcode.md","如何安装 Claude Code 并用 cc-switch 配置国内大模型",{"type":7,"value":8,"toc":286},"minimark",[9,14,18,21,24,28,31,42,45,94,122,126,129,136,142,149,152,156,159,167,171,174,177,190,194,197,203,206,209,218,221,227,230,234,242,245,249,252,256,263,267,274,278],[10,11,13],"h2",{"id":12},"claude-code-是什么","Claude Code 是什么？",[15,16,17],"p",{},"它是当前很流行的 AI 智能体工具，由 Anthropic 开发，默认使用 Claude 模型",[15,19,20],{},"但 Claude 对国内用户不友好，所以需要接入国内模型方便使用",[15,22,23],{},"智能体（Agent）可以做什么？可以简单理解为能够使 AI 自己决策，执行任务，读写电脑文件，为 AI（脑子）提供了各种工具",[10,25,27],{"id":26},"安装-nodejs","安装 Node.js",[15,29,30],{},"为了方便管理，我推荐使用 npm 安装 Claude Code，同时 node 是 Claude Code 运行的必备环境，这需要安装 Node.js",[15,32,33,34,41],{},"以 Windows 为例，",[35,36,40],"a",{"href":37,"rel":38},"https:\u002F\u002Fnodejs.org\u002Fdist\u002Fv24.16.0\u002Fnode-v24.16.0-x64.msi",[39],"nofollow","点击这里","下载安装包",[15,43,44],{},"双击安装包进行安装，安装很简单，这里简单叙述：",[46,47,48,56,65,70,75,84],"ol",{},[49,50,51,52],"li",{},"欢迎界面，点击",[53,54,55],"code",{"code":55},"Next",[49,57,58,59,62,63],{},"许可协议界面，勾选 ",[53,60,61],{"code":61},"I accept...","，点击 ",[53,64,55],{"code":55},[49,66,67,68],{},"安装路径界面，按自己习惯修改路径，点击 ",[53,69,55],{"code":55},[49,71,72,73],{},"自定义安装界面，保持默认，点击 ",[53,74,55],{"code":55},[49,76,77,78,81,82],{},"最后的工具安装界面，",[53,79,80],{"code":80},"不要","勾选，否则会下载很大的工具包，点击 ",[53,83,55],{"code":55},[49,85,86,87,90,91],{},"点击 ",[53,88,89],{"code":89},"Install","，等待进度条走完，点击 ",[53,92,93],{"code":93},"Finish",[95,96,99,111],"alert",{"icon":97,"title":98},"tabler:bounce-right","验证安装",[15,100,101,106,107,110],{},[102,103],"key",{":win":104,"code":105},"true","R"," 输入 ",[53,108,109],{"code":109},"cmd"," 打开命令行，",[15,112,113,114,117,118,121],{},"输入 ",[53,115,116],{"code":116},"node -v"," 和 ",[53,119,120],{"code":120},"npm -v","，如果能看到版本信息就说明安装成功了。",[10,123,125],{"id":124},"设置-npm-国内镜像","设置 npm 国内镜像",[15,127,128],{},"为在国内有较快的速度来使用 npm 安装软件，我们需要配置镜像源",[15,130,131,106,133,135],{},[102,132],{":win":104,"code":105},[53,134,109],{"code":109}," 打开命令行，输入：",[137,138],"copy",{"code":139,"lang":140,"prompt":141},"npm config set registry https:\u002F\u002Fregistry.npmmirror.com","ps1","PS>",[15,143,144,145,148],{},"用以下命令验证，看到 ",[53,146,147],{"code":147},"https:\u002F\u002Fregistry.npmmirror.com"," 即可：",[137,150],{"code":151,"lang":140,"prompt":141},"npm config get registry",[10,153,155],{"id":154},"安装-git","安装 git",[15,157,158],{},"Claude Code 在工作时需要终端工具，推荐使用 Git Bash",[15,160,161,162,166],{},"看",[35,163,165],{"href":164},"\u002Fposts\u002Ff9cc792","这篇文章","安装 git，会自动安装 Git Bash",[10,168,170],{"id":169},"用-npm-安装-claude-code","用 npm 安装 Claude Code",[15,172,173],{},"运行以下命令：",[137,175],{"code":176,"lang":140,"prompt":141},"npm install -g @anthropic-ai\u002Fclaude-code",[95,178,179,185],{"icon":97,"title":98},[15,180,181,106,183,110],{},[102,182],{":win":104,"code":105},[53,184,109],{"code":109},[15,186,113,187,121],{},[53,188,189],{"code":189},"claude -v",[10,191,193],{"id":192},"安装-cc-switch","安装 cc-switch",[15,195,196],{},"cc-switch 是一个很好用的 Claude Code 配置工具，我们使用它来配置国内模型",[15,198,199,41],{},[35,200,40],{"href":201,"rel":202},"https:\u002F\u002Fgh-proxy.org\u002Fhttps:\u002F\u002Fgithub.com\u002Ffarion1231\u002Fcc-switch\u002Freleases\u002Fdownload\u002Fv3.15.0\u002FCC-Switch-v3.15.0-Windows.msi",[39],[15,204,205],{},"双击安装包进行安装",[10,207,208],{"id":208},"配置模型",[15,210,211,212,217],{},"这里以 Deepseek 为例，需要提前在",[35,213,216],{"href":214,"rel":215},"https:\u002F\u002Fplatform.deepseek.com\u002F",[39],"这里","准备好余额",[15,219,220],{},"打开 cc-switch，点击右上角加号",[222,223],"pic",{":height":224,"caption":225,"src":226},"320","cc-switch 右上角加号","https:\u002F\u002Fbu.dusays.com\u002F2026\u002F05\u002F26\u002F6a156d3d01684.webp",[15,228,229],{},"选择 Deepseek 供应商",[222,231],{":height":224,"caption":232,"src":233},"选择 Deepseek","https:\u002F\u002Fbu.dusays.com\u002F2026\u002F05\u002F26\u002F6a156dedae9b2.webp",[15,235,236,237,241],{},"到",[35,238,216],{"href":239,"rel":240},"https:\u002F\u002Fplatform.deepseek.com\u002Fapi_keys",[39],"生成 api key 并复制",[15,243,244],{},"粘贴到图示位置：",[222,246],{":height":224,"caption":247,"src":248},"填写 api key","https:\u002F\u002Fbu.dusays.com\u002F2026\u002F05\u002F26\u002F6a156ea7040eb.webp",[15,250,251],{},"在下方勾选：",[222,253],{":height":224,"caption":254,"src":255},"勾选选项","https:\u002F\u002Fbu.dusays.com\u002F2026\u002F05\u002F26\u002F6a156efb2e314.webp",[15,257,258,259,262],{},"之后点击右下角",[53,260,261],{"code":261},"+添加","，添加后会自动激活配置",[10,264,266],{"id":265},"使用-claude-code","使用 Claude Code",[15,268,269,270,273],{},"配置完后，打开终端，输入 ",[53,271,272],{"code":272},"claude"," 即可运行 Claude Code",[222,275],{":height":224,"caption":276,"src":277},"Claude Code","https:\u002F\u002Fbu.dusays.com\u002F2026\u002F05\u002F26\u002F6a156fff0a469.webp",[95,279,280,283],{},[15,281,282],{},"如有上图乱码，请使用 Windows Terminal 运行",[15,284,285],{},"本文章提供的安装包链接均为写文时的最新版本，请按需更新",{"title":287,"searchDepth":288,"depth":288,"links":289},"",4,[290,292,293,294,295,296,297,298],{"id":12,"depth":291,"text":13},2,{"id":26,"depth":291,"text":27},{"id":124,"depth":291,"text":125},{"id":154,"depth":291,"text":155},{"id":169,"depth":291,"text":170},{"id":192,"depth":291,"text":193},{"id":208,"depth":291,"text":208},{"id":265,"depth":291,"text":266},[300],"技术","2026-05-26 18:06:21","如果你还不会安装 Claude Code，并配置国内大模型，可以看这篇文章，我来教你。",true,false,"md",null,{"slots":308},{},"\u002Fposts\u002F54cd2e3",{"text":311,"minutes":312,"time":313,"words":314},"3 min read",2.935,176100,587,{"title":5,"description":302},{"loc":309},"posts\u002F2026\u002Fclaudcode",[319,320],"ai","安装","tech","2026-05-26 23:09:29","SCGU0FPwtpHrV3j1fjJhZyM0sFafSihOC1i1acxOrIA",[325,306],{"title":326,"path":164,"stem":327,"date":328,"type":321,"children":-1},"如何在 Windows 安装 Git","posts\u002F2026\u002Fgit_win","2026-05-15 23:00:50",1779813765846]