Yarn是Facebook推出的,一个可能取代npm的新型包管理器npm
推荐使用npm命令进行安装,前提是你使用了淘宝镜像,这样能够将网络影响减少到最低网络
npm install -g yarn
能够下命令更换仓库地址.net
yarn config get registry # -> https://registry.yarnpkg.com
yarn config set registry 'https://registry.npm.taobao.org' # -> yarn config v0.15.0 # -> success Set "registry" to "https://registry.npm.taobao.org". # -> Done in 0.04s.
而后 yarn install 的速度就快多了
参考文章:《yarn 和 npm 都换成 淘宝镜像,就飞起来了》code
npm config set registry http://registry.npm.taobao.org
alias cnpm="npm --registry=http://registry.cnpmjs.org --cache=$HOME/.npm/.cache/cnpm"