VS2017自带的npm会去国外的镜像下载文件, 奇慢无比, 仍是马云家淘宝的镜像适合国内用户.npm
淘宝npm镜像地址: https://registry.npm.taobao.orgspa
VS中使用淘宝npm镜像, 须要如下两步:命令行
步骤1. 修改npm config, 指向淘宝npm镜像, 有3种方法: code
1.经过config命令字符串
npm config set registry https://registry.npm.taobao.org
npm info underscore (若是上面配置正确这个命令会有字符串response)
2.命令行指定underscore
npm --registry https://registry.npm.taobao.org info underscore
3.编辑
~/.npmrc
加入下面内容get
registry = https://registry.npm.taobao.org
步骤2. 修改 VS 的 Web Package Managementclass
如图, 添加如下三项, 而后就能够愉快的在VS中使用淘宝npm镜像了.配置