淘宝镜像

本文是解决使用npmyarn时,下载安装包缓慢的问题。
解决这个问题最简单的方法就是设置安装包的仓库地址为淘宝镜像地址。npm

npm

设置淘宝地址code

npm config set registry https://registry.npm.taobao.org/

设置官方地址get

npm config set registry https://registry.npmjs.org/

查看仓库地址淘宝

npm get registry

yarn

设置淘宝地址下载

yarn config set registry https://registry.npm.taobao.org/

设置官方地址方法

yarn config set registry https://registry.yarnpkg.com

查看仓库地址yarn

yarn config get registry