|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 报错如下: |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm ERR! request to https://registry.npm.taobao.org/y18n/download/y18n-5.0.8.tgz failed, reason: certificate has expired | |
|------------------|
| 错误原因:SSL证书过期 |
解决方法
1、更新NPM
bash
npm install -g npm@latest
如果更新不起作用,可能是因为你的Node.js版本太旧。你可以去Node.js官网下载最新版本的Node.js,它会自带最新版本的npm。→ Node.js官方地址
2、忽略过期证书的检查
bash
npm set strict-ssl=false