npm镜像管理
查看当前源地址:npm config list
metrics-registry = "https://registry.npmjs.org/"
1
修改当前源地址:
npm set registry https://registry.npm.taobao.org/
1
淘宝npm常用镜像地址(https://developer.aliyun.com/mirror/NPM?from=tnpm (opens new window)) 使用
安装使用 cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
1
使用 nrm
来管理镜像源
推荐使用 yrm
使用和 nrm
方法一致
安装: npm install nrm -g --save
查看默认配置: nrm ls
- npm -------- https://registry.npmjs.org/ (opens new window)
- yarn ------- https://registry.yarnpkg.com/ (opens new window)
- cnpm ------- http://r.cnpmjs.org/ (opens new window)
- taobao ----- https://registry.npm.taobao.org/ (opens new window)
- nj --------- https://registry.nodejitsu.com/ (opens new window)
- npmMirror -- https://skimdb.npmjs.com/registry/ (opens new window)
- edunpm ----- http://registry.enpmjs.org/ (opens new window) 查看当前使用的源:nrm current
切换源: nrm use cnpm
添加自定义源: nrm add mrcdh http://registry.npm.mrcdh.org
删除配置:nrm del mrcdh
测试镜像源速度:nrm test cnpm
上次更新: 2023/09/22, 16:54:32