npm set registry https://registry.npm.taobao.org npm set disturl https://npm.taobao.org/dist npm cache clean --force
npm i -g cnpm --registry=https://registry.npm.taobao.org
如果还报错,sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose
cnpm -v
原文:https://www.cnblogs.com/vipsoft/p/15032823.html