npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm ERR! request to https://registry.

npm install时报错code CERT_HAS_EXPIRED
一、报错情况
二、解决方案
一、报错情况 
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/vue-loader failed, reason: certificate has expired
 
npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Environment\nvm\node_cache\_logs\2024-01-22T04_34_51_215Z-debug.log
这就说:npm的证书失效了,它不再支持自签名证书 

二、解决方案
查看自己的下载源

npm config get registry
发现我们之前配置了下载镜像源为https开头的, 

https://registry.npm.taobao.org/
执行命令清除npm缓存 

npm cache clean --force
执行命令取消ssl验证 

npm config set strict-ssl false
 再次执行npm install ***,还不行可以尝试设置你的npm镜像源为http开头的,不使用https

npm config set registry http://registry.npm.taobao.org

你可能感兴趣的:(前端,npm,vue,node.js,npm,https,前端)