其他分享
首页 > 其他分享> > 下载npm依赖包报错 npm ERR code ERR_TLS_CERT_ALTNAME_INVALID npm ERR errno ERR_TLS_CERT_ALTNAME_INVALID

下载npm依赖包报错 npm ERR code ERR_TLS_CERT_ALTNAME_INVALID npm ERR errno ERR_TLS_CERT_ALTNAME_INVALID

作者:互联网

npm报错 npm ERR code ERR_TLS_CERT_ALTNAME_INVALID npm ERR errno ERR_TLS_CERT_ALTNAME_INVALID
在下载npm依赖包输入 npm install 命令的时候出错 以下是错误信息

错误信息:

npm ERR code ERR_TLS_CERT_ALTNAME_INVALID
npm ERR errno ERR_TLS_CERT_ALTNAME_INVALID
npm ERR request to https://registry.cnpmjs.org/vue-cli 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\yy\AppData\Roaming\npm-cache_logs\2020-06-12T05_41_01_727Z-debug.log

解决方法

输入命令:

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

之后再输入npm install 即可

标签:npm,TLS,ERR,INVALID,CERT,ALTNAME
来源: https://blog.csdn.net/weixin_59260591/article/details/121554694