Node.js/npm/源

来自康健生活
Kangkk​(留言 | 贡献)2025年7月18日 (五) 19:36的版本 (→registry)

标题文本

源地址

官方 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/

工具

registry

[jian@kang /home/kangkk]$
npm config get registry
http://registry.npm.qiwoo.org/

设置 registry。

/home/kangkk
# npm config set @myco:registry http://reg.example.com
npm config set registry https://registry.npm.taobao.org

进行分开测试

/home/kangkk
npm config set @q:registry http://registry.npm.qiwoo.org
npm install --registry=https://registry.npmmirror.com

nrm

npm i -g nrm
kangjian@kangkk:~/github/kangkk.github.io$
nrm ls
* npm -------- https://registry.npmjs.org/
  yarn ------- https://registry.yarnpkg.com/
  cnpm ------- http://r.cnpmjs.org/
  taobao ----- https://registry.npm.taobao.org/
  nj --------- https://registry.nodejitsu.com/
  npmMirror -- https://skimdb.npmjs.com/registry/
  edunpm ----- http://registry.enpmjs.org/
kangjian@kangkk:~/github/kangkk.github.io$
nrm use taobao
Registry has been set to: https://registry.npm.taobao.org/

add

[jian@kang /home/kangkk]$
nrm add company http://registry.npm.qiwoo.org
    add registry company success