前端依赖下载速度过慢解决方法,nrm 镜像管理工具

npm 默认镜像 :https://registry.npmjs.org/

问题

使用 npm install 安装依赖的时候,受网络的限制,速度会很慢。

解决

使用国内镜像代理。

nrm

nrm 是镜像源管理工具;

1. 安装 nrm
powershell 复制代码
npm install nrm --global
powershell 复制代码
# 查看镜像源列表
nrm ls

淘宝原镜像 https://registry.npm.taobao.org 已更改为 https://registry.npmmirror.com

2. 测试当前环境下,哪个镜像源速度最快。
powershell 复制代码
nrm test
3. 切换镜像源
powershell 复制代码
npm config get registry # 查看当前镜像源
nrm use taobao # 等价于 npm config set registry https://registry.npmmirror.com

使用 cnpmyarn

powershell 复制代码
npm install -g cnpm --registry=https://registry.npmmirror.com
powershell 复制代码
cnpm install -g yarn
阿里云针对淘宝镜像更改的说明


npmmirror 中国镜像站

相关推荐
子兮曰4 小时前
OpenClaw入门:从零开始搭建你的私有化AI助手
前端·架构·github
吴仰晖4 小时前
使用github copliot chat的源码学习之Chromium Compositor
前端
1024小神4 小时前
github发布pages的几种状态记录
前端
不像程序员的程序媛6 小时前
Nginx日志切分
服务器·前端·nginx
北原_春希6 小时前
如何在Vue3项目中引入并使用Echarts图表
前端·javascript·echarts
尽意啊6 小时前
echarts树图动态添加子节点
前端·javascript·echarts
吃面必吃蒜6 小时前
echarts 极坐标柱状图 如何定义柱子颜色
前端·javascript·echarts
O_oStayPositive6 小时前
Vue3使用ECharts
前端·javascript·echarts
竹秋…6 小时前
echarts自定义tooltip中的内容
前端·javascript·echarts
宝贝露.6 小时前
Axure引入Echarts图无法正常显示问题
前端·javascript·echarts