红茶的个人站点

  • 首页
  • 专栏
  • 开发工具
  • 其它
  • 隐私政策
Awalon
Talk is cheap,show me the code.
  1. 首页
  2. 开发工具
  3. 正文

NPM 使用镜像

2025年9月8日 6点热度 0人点赞 0条评论

通常使用下面的方式为 NPM 设置镜像:

npm config set registry https://registry.npmmirror.com

用下面的命令可以恢复镜像为官方镜像:

npm config set registry https://registry.npmjs.org

如果要查看当前使用的镜像:

npm config get registry

NRM

更推荐的方式是使用 nrm 工具管理 NPM 镜像,这个工具同样使用 NPM 安装:

sudo npm install -g nrm

因为要使用-g全局安装,所以这里要使用sudo用 root 权限安装,否则可能报错。

查看 nrm 支持的镜像列表:

nrm ls

切换镜像为淘宝镜像:

nrm use taobao

测试当前镜像速度:

nrm test

The End.

本作品采用 知识共享署名 4.0 国际许可协议 进行许可
标签: node.js npm
最后更新:2025年9月8日

魔芋红茶

加一点PHP,加一点Go,加一点Python......

点赞
< 上一篇

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2021 icexmoon.cn. ALL RIGHTS RESERVED.
本网站由提供CDN加速/云存储服务

Theme Kratos Made By Seaton Jiang

宁ICP备2021001508号

宁公网安备64040202000141号