node 出现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:

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

在搭建vue项目的时候出错:(从来没出现过这种错误......)

 

 

 解决方法:

输入:

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

之后再输入npm install --global vue-cli即可

 

 

参考自:https://blog.csdn.net/Lianxingjie_1024/article/details/80275618

posted @ 2020-06-12 14:25  圆圆呀~  阅读(9612)  评论(4编辑  收藏  举报