npm 設置淘寶鏡像地址
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm config set registry https://registry.npm.taobao.org
這樣npm命令就可以使用cnpm命令來代替,比如在使用react腳手架命令create-react-app
時會報的超時錯誤,這樣設置就可以解決了。
yarn 設置淘寶鏡像地址
yarn config set registry https://registry.npm.taobao.org
在使用react腳手架命令create-react-app
時會報的超時錯誤:
There appears to be trouble with your network connection. Retrying...
設置完成后可以解決。