今天做案例想安装一个工具 npm install json-server 的时候发现报错了
E:\My_Vue2+3\07_day\vue-cart-demo>npm i json-server -g
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/json-server failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\c\AppData\Roaming\npm-cache_logs\2024-01-22T07_34_31_193Z-debug.log
说什么证书过期
解决方法:把这三句运行一次,再次安装我的插件,解决
npm cache clean --force
npm config set strict-ssl false
npm install