本文讲述了npm遇到CERT_HAS_EXPIRED错误的常见原因,包括SSL证书过期、关闭SSL验证的危险性以及如何通过清除缓存和更换淘宝镜像源来解决问题。
一、出现问题
C:\Users\***>npm install -g @vue/cli
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/@vue%2fcli failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in: D