npm安装cnpm时报错:npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID

使用 npm install cnpm -g 安装淘宝镜像加速器cnpm 时报错:

1
2
3
4
5
6
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

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2020-10-08T12_17_57_800Z-debug.log

解决办法:

输入如下命令:

1
npm config set strict-ssl false npm install -g supervisor

执行成功后再执行:npm install cnpm -g 即可!


npm安装cnpm时报错:npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
https://river106.cn/posts/f2444692.html
作者
river106
发布于
2020年10月8日
许可协议