claude - windows | linux 国内镜像安装

文章目录

安装claude

安装顺序: nvm|node -> git -> claude -> settings.json基础设置

windows:

1.首先安装node, 进入这个网址:https://nodejs.org/en/download/

下载windows Installer.msi文件,进行安装

2.安装github windows桌面版

https://desktop.github.com/download/

进入该网址,下载windows 64bit,安装

3.下载claude:

打开windows powershell,使用国内镜像安装

复制代码
npm i -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com

3.1设置运行路径:

在上图中,可以看到 C:\Users\Administrator. local\bin 不在PATH中,因此,将 C:\Users\Administrator. local\bin 设置到系统路径里面。

windows键 - 系统变量 - 编辑系统变量 - 将C:\Users\Administrator. local\bin复制到 PATH

3.2 另外打开一个powershell:

运行claude,查看是否已经正常安装

复制代码
claude --version

4.设置settings.json文件:

打开windows上的对应的user/.claude,比如我的在"C:\Users\caisn\.claude"

配置基础信息:

复制代码
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "换成自己的",
    "ANTHROPIC_BASE_URL": "换成自己的",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "model": "deepseek-v4-pro",
  "enabledPlugins": {
    "document-skills@anthropic-agent-skills": true,
    "example-skills@anthropic-agent-skills": true,
    "superpowers@claude-plugins-official": false,
    "claude-scientific-writer@claude-scientific-writer": true
  },
  "extraKnownMarketplaces": {
    "anthropic-agent-skills": {
      "source": {
        "source": "github",
        "repo": "anthropics/skills"
      }
    },
    "claude-scientific-writer": {
      "source": {
        "source": "git",
        "url": "https://github.com/K-Dense-AI/claude-scientific-writer.git"
      }
    }
  },
  "autoUpdatesChannel": "latest",
  "ENABLE_TOOL_SEARCH": "true"
}

安装完毕,可以正常使用啦!

linux

1.首先安装node, 进入这个网址:https://nodejs.org/en/download/

按照注意将上面的下载指令设置成自己需要的环境:

比如设置成linux、使用ubuntu v24.18.0 LTS环境进行下载的话,使用nvm进行下载,并同时下载npm,那么得到了下面的指令:

复制代码
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.5/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 24

# Verify the Node.js version:
node -v # Should print "v24.18.0".

# Verify npm version:
npm -v # Should print "11.16.0".

将这些命令复制到linux上运行,等待安装完毕。

2.下载git

复制代码
sudo apt update
sudo apt upgrade
sudo apt install git

3.安装claude:

复制代码
# 使用国内镜像安装
REGISTRY=https://registry.npmmirror.com
npm i -g @anthropic-ai/claude-code --registry=$REGISTRY

查看是否安装完成:

复制代码
. ~/.bashrc 
claude --version

4.设置settings.json文件

vim ~/.claude/settings.json

配置基础信息:

复制代码
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "换成自己的",
    "ANTHROPIC_BASE_URL": "换成自己的",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "model": "deepseek-v4-pro",
  "enabledPlugins": {
    "document-skills@anthropic-agent-skills": true,
    "example-skills@anthropic-agent-skills": true,
    "superpowers@claude-plugins-official": false,
    "claude-scientific-writer@claude-scientific-writer": true
  },
  "extraKnownMarketplaces": {
    "anthropic-agent-skills": {
      "source": {
        "source": "github",
        "repo": "anthropics/skills"
      }
    },
    "claude-scientific-writer": {
      "source": {
        "source": "git",
        "url": "https://github.com/K-Dense-AI/claude-scientific-writer.git"
      }
    }
  },
  "autoUpdatesChannel": "latest",
  "ENABLE_TOOL_SEARCH": "true"
}

好啦!可以开始使用啦!!

相关推荐
Elastic 中国社区官方博客1 小时前
Elastic 在 Everest Group 企业搜索产品 PEAK Matrix® 评估 2026 中被评为领导者
大数据·运维·人工智能·elasticsearch·搜索引擎·ai·全文检索
程序员在囧途1 小时前
likeadmin-api API 中转站怎么做统一报价?从 /pricing、/user/balance 到 task_id 回执的落地方法
运维·服务器·数据库·likeadmin-api·api中转站·token计费
cookies_s_s1 小时前
C++ 字符串动态创建对象 -- 工厂模式、自动注册、模板递归动态调用
服务器·开发语言·c++
想你依然心痛2 小时前
Linux用户空间与内核空间通信:netlink、ioctl、mmap 零拷贝与性能对比
linux·运维·服务器
沉静的小伙2 小时前
在微服务中使用领域事件
java·运维·微服务
程序员在囧途2 小时前
likeadmin-api API 算力超市怎么做供应商切换?统一鉴权、task_id 和 callback_url 才能稳交付
java·服务器·数据库·开放api·likeadmin-api·api算力超市
wenzhangli73 小时前
oodAgent 4.0 Skills分布式调度 — 从Code Agent实战看自主维护的Agent网络
运维·网络·人工智能·自动化
做个文艺程序员3 小时前
Linux第12篇:性能监控与瓶颈分析——CPU/内存/IO/网络全维度
linux·运维·网络
WZF-Sang3 小时前
网络基础——2
服务器·网络·c++·学习·网络编程·php
K姐研究社3 小时前
OiiOii 2.0 实测 – 智能画布实现 AI 视频创作自动化
运维·人工智能·自动化