10秒一招解决你的npm镜像问题

本文介绍了如何使用nrm工具在npm中方便快捷地管理镜像,包括查看当前镜像地址、安装nrm、切换镜像以及验证镜像更改的方法,帮助读者提升npm包管理效率。
摘要由CSDN通过智能技术生成

还在辛苦npm安装cnpm镜像,切换镜像都2024年了,10秒一招解决你的npm镜像问题
上教程

首先查看镜像地址

 npm config get registry
 会输出以下结果
  # https://registry.npmjs.org/

第一步 安装 nrm

npm i nrm -g

第二步 查看镜像地址

nrm ls list
会输出一下结果 ## 星号代表当前使用的镜像地址
#* npm ---------- https://registry.npmjs.org/         
#  yarn --------- https://registry.yarnpkg.com/
#  tencent ------ https://mirrors.cloud.tencent.com/npm/
#  cnpm --------- https://r.cnpmjs.org/
#  taobao ------- https://registry.npmmirror.com/
#  npmMirror ---- https://skimdb.npmjs.com/registry/
#  ali ---------- https://registry.npm.taobao.org/
#

第三步 切换镜像地址

nrm use taobao
输出
#  SUCCESS  The registry has been changed to 'taobao'.

第四步 nrm 查看是否切换成功切换镜像

再次执行第二步

nrm ls list
#  npm ---------- https://registry.npmjs.org/         
#  yarn --------- https://registry.yarnpkg.com/
#  tencent ------ https://mirrors.cloud.tencent.com/npm/
#  cnpm --------- https://r.cnpmjs.org/
#* taobao ------- https://registry.npmmirror.com/
#  npmMirror ---- https://skimdb.npmjs.com/registry/
#  ali ---------- https://registry.npm.taobao.org/
#

最后再次检验镜像地址

npm config get registry

输出结果
# https://registry.npmmirror.com/

在这里插入图片描述

  • 25
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值