npm安装 cnpm 错误 certificate has expired

request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired

 

 

方法1

// 1. 清空缓存
npm cache clean --force
// 2. 关闭SSL验证
npm config set strict-ssl false

方法2

// 1. 清空缓存
npm cache clean --force
// 2. 切换新源
npm config set registry https://registry.npmmirror.com
// 3. 查看源是否设置成功
npm config get registry
posted @ 2024-03-02 16:15  暖暖De幸福  阅读(922)  评论(0编辑  收藏  举报