安装并使用claude code

一 安装claude

参考:

Claude Code 安装与使用 | 菜鸟教程

报错:

复制代码
PS C:\Users\leaf> irm https://claude.ai/install.ps1 | iex
Setting up Claude Code...

✘ Installation failed

Failed to fetch version from https://downloads.claude.ai/claude-code-releases/latest: ECONNREFUSED


Try running with --force to override checks

✅ Installation complete!

PS C:\Users\leaf> claude --version
claude : 无法将"claude"项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径
正确,然后再试一次。
所在位置 行:1 字符: 1
+ claude --version
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (claude:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

是代理问题,解决:

复制代码
PS C:\Users\leaf> $env:HTTP_PROXY = "http://127.0.0.1:7897"
PS C:\Users\leaf> $env:HTTPS_PROXY = "http://127.0.0.1:7897"
PS C:\Users\leaf> irm https://claude.ai/install.ps1 | iex
Setting up Claude Code...

✔ Claude Code successfully installed!

  Version: 2.1.121

  Location: C:\Users\leaf\.local\bin\claude.exe


  Next: Run claude --help to get started

⚠ Setup notes:
  ● Native installation exists but C:\Users\leaf\.local\bin is not in your PATH. Add it by opening: System Properties →
    Environment Variables → Edit User PATH → New → Add the path above. Then restart your terminal.


✅ Installation complete!

然后添加环境变量

把路径加入 PATH

  1. 右键「此电脑」→ 属性 → 高级系统设置
  2. 点击「环境变量」
  3. 在上半部分「用户变量」中找到 Path,双击编辑
  4. 点击「新建」,粘贴:C:\Users\leaf\.local\bin
  5. 一路点 OK 保存

然后关掉当前 PowerShell,重新打开一个新窗口,运行:

复制代码
claude --version

二 安装cc switch

参考:

CC Switch 一键切换 API | 菜鸟教程

三 claude code+deepseekV4

接入 Claude Code | DeepSeek API Docs

相关推荐
走马走马3 小时前
claude code 使用
claude code
北暮城南4 小时前
VS Code 与 IDEA 集成 Claude Code 实战指南——基于智谱 AI 大模型的 AI 辅助编码环境搭建
vscode·idea·claude·intellij idea·claude code·claude code cli
Rubin智造社7 小时前
Claude Code开发者大会系列2|“饮鸩止渴”还是“即刻解药”?Anthropic与SpaceX的联姻内幕
大数据·数据库·人工智能·开发者大会·anthropic·claude code
乾坤瞬间21 小时前
【claude code 如何构建 agent 实践9】从自由协作到结构化协议: 从S09到S10的演进
claude code·code agent
花千树-0101 天前
Proposer-Critic 多轮辩论:两个 LLM Agent 用 loop() 逼近共识
langchain·agent·ai编程·skill·multi-agent·claude code·ai 工程化
秋堂主1 天前
Claude Code记忆系统
cc·claude code
乾坤瞬间1 天前
【claude code 如何构建 agent 实践1】Agent Loop 永动机与工具扩展机制详解[S02]
claude code·code agent
布朗克1681 天前
Claude Code 进阶玩法:MCP集成、自定义配置与团队协作
arcgis·claude code
qq_gpp2 天前
【Claude Code】Claude Code 的 Checkpoint 是怎么实现的
checkpoint·claude code·rewind