原因可能是node版本比较低,指定安装cnpm版本即可
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type “npm:”: npm:string-width@^4.2.0
npm cache clean --force
npm config set strict-ssl false
npm install -g cnpm --registry=https://registry.npm.taobao.org
改为
npm install -g cnpm@7.1.1 --registry=https://registry.npm.taobao.org
即可