npm install -g cnpm --registry=https://registry.npm.taobao.org
npm config set registry https://registry.npm.taobao.org
npm config get registry
cnpm config get registry
npm config set registryhttps://registry.npmjs.org
设置之后,记得通过npm config get registry 查看源是否设置成功
原文:https://www.cnblogs.com/uzi666/p/15350757.html