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

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

相关推荐
Decay__1 小时前
12_MySQL InnoDB 内存与锁调优 —— Buffer Pool、redo log、隔离级别与锁等待
运维·数据库·sql·mysql·架构
java_logo3 小时前
Docker 部署 Dify:轻松搭建 LLM 应用开发平台
运维·docker·容器
方便面不加香菜5 小时前
Docker Container -- 综合实战案例详解
运维·docker·容器
LongRunning5 小时前
【Linux】RK3568-OpenCV+YOLO(八)
linux·opencv·yolo
海洋之恒6 小时前
GitHub Actions 自动化:5 个真实运维提效案例
运维·自动化·github
迪康coolmu7 小时前
出差终端数据安全落地实战:基于迪康端点安全一体化管理系统的四道防线实践
运维·服务器·经验分享·笔记·其他·安全·php
民乐团扒谱机8 小时前
【微实验】NSGA-II(非支配排序遗传算法)——解决多目标优化问题的“自然选择模拟器”
linux·人工智能·算法
물の韜9 小时前
ZYNQ/FMQL系列Linux之I2C开发实战
linux·arm开发·嵌入式硬件·设备树·iic·zynq
qq_371802119 小时前
Ubuntu Linux中安装WorkBuddy
linux·运维·服务器·ubuntu