使用淘寶鏡像
臨時(shí)使用
npm --registry https://registry.npm.taobao.org
持久使用
npm config set registry https://registry.npm.taobao.org
通過cnpm使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用官方鏡像
npm config set registry https://registry.npmjs.org/
查看npm源地址
npm config get registry