npm install -g cnpm安装报错

npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! request to https://registry.cnpmjs.org/cnpm failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.cnpmjs.org. is not in the cert's altnames: DNS:r.cnpmjs.org

解决办法:

  1. 先清除掉以前的代理设置
npm config set proxy null
npm config set https-proxy null
  1. 重新设置
npm config set registry http://registry.cnpmjs.org/
上一篇:vue环境搭建创建项目


下一篇:vue-cli的安装步骤