欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

npm install -g cnpm安装报错

程序员文章站 2022-06-15 14:55:18
...
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/