npm install certificate has expired 证书过期的解决办法

npm install 时 certificate has expired 错误的解决办法

报错:npm ERR! request to https://registry.npm.taobao.org/events failed, reason: certificate has expired

 
shell
复制代码
npm install 
npm ERR! code CERT_HAS_EXPIRED  
npm ERR! errno CERT_HAS_EXPIRED  
npm ERR! request to https://registry.npm.taobao.org/events failed, reason: certificate has expired  
  
npm ERR! A complete log of this run can be found in:  
npm ERR! /.npm/_logs/2024-01-24T08_52_27_547Z-debug.log  
ERROR: Job failed: exit status 1

原因:证书过期

简单粗暴的解决办法:
关闭 npm ssl 严格证书检查

 
shell
复制代码
npm set strict-ssl false

或切换到官方源:
npm config set registry https://registry.npmjs.org/
 
 淘宝镜像源

npm config set registry https://registry.npmmirror.com

 
posted @   GaoYanbing  阅读(17531)  评论(1编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤
历史上的今天:
2021-02-04 基于 GlusterFS 实现 Docker 集群的分布式存储
2021-02-04 Keepalive+Haproxy+Mycat高可用环境搭建
点击右上角即可分享
微信分享提示