先看错误
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\liang\AppData\Local\npm-cache\_logs\2024-07-26T09_39_09_737Z-debug-0.log
解决办法:
将命令
npm config set registry https://registry.npm.taobao.org
修改为
npm config set registry https://registry.npmmirror.com