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"
}

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

相关推荐
腾科IT教育2 小时前
Oracle认证怎么选?2026年OCP/OCM报考指南
linux·运维·华为认证·hcie·开闭原则·datacom
幸福指北3 小时前
🚀 开源了,一个人 + AI 肝出一个 AI 终端 | AShell 技术分享
运维·人工智能·ai·终端
肥胖小羊4 小时前
微信社群自动化管理与防骚扰系统的设计与实现
运维·自动化
AI办公探索者5 小时前
仓储物流AI任务执行的技术拆解:从WMS自动化到多设备协同的落地路径
运维·人工智能·ai·自动化
longerxin20206 小时前
nano编辑器插入、编辑完整操作教程(Linux日志/配置专用)
linux·运维·编辑器
cesium vue7 小时前
nginx 流媒体配置
运维·nginx
木心术17 小时前
GitHub Actions自动化运维实战:从CI/CD到全链路DevOps
运维·自动化·github
糯米导航7 小时前
实践教程|搭建电商 AI 无限画布,实现百款商品主图自动化批量生成
运维·人工智能·自动化
朴马丁8 小时前
从制造到智造:PLM如何赋能企业研发创新
大数据·运维·人工智能·食品行业·流程行业plm·化工新材料行业·新能源材料行业
爱小黄8 小时前
使用docker搭建集群-使用 Docker 搭建 KingbaseES 集群
运维·docker·容器