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"