npm添加淘宝镜像

原文:http://cnodejs.org/topic/4f9904f9407edba21468f31e

npm是一个很好用的工具,全场是Node Packet Manager,是一个nodejs的包管理工具,但是美中不足的是当我们去安转包的时候却发现下载的速度太慢,但是没关系,还是有方法的就是利用淘宝的国内镜像,一下是3个设置的方法:

镜像使用方法(三种办法任意一种都能解决问题,我用的第一种):

1.通过config命令

npm config set registry https://registry.npm.taobao.org 
npm info underscore (如果上面配置正确这个命令会有字符串response

2.命令行指定

npm --registry https://registry.npm.taobao.org info underscore 

3.编辑 ~/.npmrc 加入下面内容

registry = https://registry.npm.taobao.org
原文地址:https://www.cnblogs.com/guazi/p/6735767.html