本文是解決使用npm
和yarn
時,下載安裝包緩慢的問題。
解決這個問題最簡單的方法就是設置安裝包的倉庫地址爲淘寶鏡像地址。npm
設置淘寶地址code
npm config set registry https://registry.npm.taobao.org/設置官方地址get
npm config set registry https://registry.npmjs.org/查看倉庫地址淘寶
npm get registry
設置淘寶地址下載
yarn config set registry https://registry.npm.taobao.org/設置官方地址方法
yarn config set registry https://registry.yarnpkg.com查看倉庫地址yarn
yarn config get registry