nodeJS 的 npm 设置国内高速镜像之淘宝镜像的方法

 

1、我们知道 nodeJS 是老外搞出来的,服务器放在了国外,国内的小朋友访问起来会比较慢,阿里巴巴的淘宝给出了有力支持,现在我们就将 nodeJS 的镜像地址切换为国内的淘宝镜像。

2、查看当前的镜像地址:
  npm get registry
  得到
  https://registry.npmjs.org/

3、在 CMD 中执行如下命令,配置注册的镜像地址为淘宝镜像:
  npm config set registry http://registry.npm.taobao.org/
  或
  yarn config set registry http://registry.npm.taobao.org/

4、如果想换回来的话将淘宝镜像再换成 https://registry.npmjs.org/ 即可:
  npm config set registry https://registry.npmjs.org/

5、备注:
  NPM = NodeJS Package Manager

原文地址:https://www.cnblogs.com/hapday/p/13488770.html