recommend two npm registries in China

做Web前端开发离不开npm, 开发人员可以使用npm来管理项目的各种依赖包,公开的依赖包都被保存在一个统一的服务器上,它的访问地址为https://registry.npmjs.org。然而在国内访问这个地址时,有时比较慢,下载依赖包的过程中经常卡住。这里推荐两个国内的npm registry。从这两个registry下载package时,速度相对快很多。

第一个是阿里巴巴的npm registry:

https://registry.npm.taobao.org

相应的介绍可以在如下地址中查看:

https://npm.taobao.org

第二个是华为的npm registry:

https://mirrors.huaweicloud.com/repository/npm/

相应的介绍可以在如下地址中查看:

https://bbs.huaweicloud.com/forum/thread-1803-1-1.html

使用如下命令可以设置当前用户的npm registry:

npm config set regitry https://mirrors.huaweicloud.com/repository/npm/

经过我测试,在我电脑上运行 npx create-reate-app hello-world 命令时,下载包的速度都很快。