前端依赖下载速度过慢解决方法,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 中国镜像站

相关推荐
weixin-a1530030831635 分钟前
【playwright篇】教程(十七)[html元素知识]
java·前端·html
ai小鬼头1 小时前
AIStarter最新版怎么卸载AI项目?一键删除操作指南(附路径设置技巧)
前端·后端·github
一只叫煤球的猫2 小时前
普通程序员,从开发到管理岗,为什么我越升职越痛苦?
前端·后端·全栈
vvilkim2 小时前
Electron 自动更新机制详解:实现无缝应用升级
前端·javascript·electron
vvilkim2 小时前
Electron 应用中的内容安全策略 (CSP) 全面指南
前端·javascript·electron
aha-凯心2 小时前
vben 之 axios 封装
前端·javascript·学习
遗憾随她而去.2 小时前
uniapp 中使用路由导航守卫,进行登录鉴权
前端·uni-app
xjt_09013 小时前
浅析Web存储系统
前端
foxhuli2293 小时前
禁止ifrmare标签上的文件,实现自动下载功能,并且隐藏工具栏
前端
青皮桔4 小时前
CSS实现百分比水柱图
前端·css