1.查看原本的鏡像地址
npm get registry
> https://registry.npmjs.org/
設成淘寶的
npm config set registry http://registry.npm.taobao.org/
將npm替換為cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
安裝yarn
cnpm install yarn -g 全局安裝yarn
2.換成原來的
npm config set registry https://registry.npmjs.org/
針對mac 設置默認node版本
首先切換到 你的版本號
nvm use 8.10.0
之后設置微默認的版本
nvm alias default 8.10.0