NPM国内镜像源多选择与镜像快速切换工具(nrm)介绍

多镜像源选择

淘宝镜像(推荐)

镜像地址:https://registry.npmmirror.com

特性:官方推荐,镜像更新速度快,稳定性高。

使用方式:

复制代码
npm config set registry https://registry.npmmirror.com

恢复默认

复制代码
npm config set registry https://registry.npmjs.org

华为云开源镜像

镜像地址:https://mirrors.huaweicloud.com/repository/npm/

特性:华为提供的开源镜像,速度较快,可靠性高。

使用方式

复制代码
npm config set registry https://mirrors.huaweicloud.com/repository/npm/

腾讯云 npm 镜像

镜像地址:https://mirrors.cloud.tencent.com/npm/

特性:腾讯云提供,速度和可靠性不错。

使用方式

复制代码
npm config set registry https://mirrors.cloud.tencent.com/npm/

阿里云 npm 镜像

镜像地址:https://npm.aliyun.com/

特性:阿里云提供的镜像,但不如淘宝镜像更新频繁。

使用方式

复制代码
npm config set registry https://npm.aliyun.com/

清华大学开源镜像站

镜像地址:https://mirrors.tuna.tsinghua.edu.cn/npm/

特性:清华大学提供的开源镜像,稳定性和更新速度都不错。

使用方式

复制代码
npm config set registry https://mirrors.tuna.tsinghua.edu.cn/npm/

npm 镜像快速切换工具(nrm)

安装 nrm

复制代码
npm install -g nrm

查看可用镜像

复制代码
nrm ls

切换镜像

比如切换到淘宝镜像:

复制代码
nrm use taobao

恢复默认镜像

切换回官方的 npm 仓库:

复制代码
nrm use npm
相关推荐
前端小万3 分钟前
思考,行动,复盘|2026
前端·后端·面试
拖孩42 分钟前
# 我又用 AI 做了个小程序:24 天,记录我这辈子认识的人
前端·后端·微信小程序
徐小夕1 小时前
深度拆解 Design Agent:LangChain 出品,AI 设计从「好看」走向「可用」
前端·vue.js·github
1-1=01 小时前
Vue 表单数据和过滤器
前端·javascript·vue.js
oil欧哟2 小时前
Oil UI 的设计思路与日常使用方式:让 AI 摆脱默认模板并保持多页面风格统一
前端
恋猫de小郭2 小时前
Jetpack Compose 1.13 发布,憋了这么久终有交代了
android·前端·flutter
头发还在的女程序员2 小时前
智慧物业源码解析:房屋档案与业主变更怎样保持历史业务连续
前端·javascript·vue.js·物业管理·小区物业·智慧物业
JianZhen✓3 小时前
电商 SKU 选择器:后端只给扁平列表,前端怎么反推规格矩阵并做到 O(1) 命中
前端·矩阵·状态模式
feixing_fx11 小时前
第一个 JS 程序:在浏览器控制台和 Node 中分别运行
开发语言·前端·javascript·前端框架·ecmascript
feixing_fx12 小时前
变量与声明:let、const、var 的选择边界
开发语言·前端·javascript·前端框架