ObsiBlog即将为您展现精彩内容
192 字
1 分钟
国内npm源镜像

国内npm源镜像(npm加速下载) 指定npm镜像

国内npm源镜像#

指定npm镜像#

NPM镜像提供方NPM镜像地址
NPM官方https://registry.npmjs.org/
淘宝https://registry.npm.taobao.org/
阿里云https://npm.aliyun.com/
腾讯云https://mirrors.cloud.tencent.com/npm/
华为云https://mirrors.huaweicloud.com/repository/npm/
网易https://mirrors.163.com/npm/
中科院大学http://mirrors.ustc.edu.cn/
清华大学https://mirrors.tuna.tsinghua.edu.cn/

切换源#

Terminal window
npm config set registry 源的地址

查看当前的镜像源#

Terminal window
npm config get registry

推荐使用上面的方式指定npm镜像,当然方法不唯一,也可以用 nrm 去指定npm镜像

什么是nrm#

nrm 是一个 npm 源管理器,允许你快速地在 npm 源间切换

安装nrm#

Terminal window
npm install -g nrm1

使用#

查看可选的源#

Terminal window
nrm ls
1

切换#

如果要切换到taobao源,执行命令

Terminal window
nrm use taobao1

测试速度#

Terminal window
nrm test
国内npm源镜像
https://blog.hiyun.top/posts/国内npm源镜像/
作者
𝑶𝒃𝒔𝒊𝒅𝒊𝒂𝒏
发布于
2024-11-16
许可协议
CC BY-NC-SA 4.0

这篇文章是否对你有帮助?