npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm ERR! request to https://registry.

npm install时报错code CERT_HAS_EXPIRED

一、报错情况

二、解决方案

一、报错情况

npm ERR! code CERT_HAS_EXPIRED

npm ERR! errno CERT_HAS_EXPIRED

npm ERR! request to https://registry.npm.taobao.org/vue-loader failed, reason: certificate has expired

npm ERR! A complete log of this run can be found in:

npm ERR! D:\Environment\nvm\node_cache\_logs\2024-01-22T04_34_51_215Z-debug.log

这就说:npm的证书失效了,它不再支持自签名证书

二、解决方案

查看自己的下载源

npm config get registry

发现我们之前配置了下载镜像源为https开头的,

https://registry.npm.taobao.org/

执行命令清除npm缓存

npm cache clean --force

执行命令取消ssl验证

npm config set strict-ssl false

再次执行npm install ***,还不行可以尝试设置你的npm镜像源为http开头的,不使用https

npm config set registry http://registry.npm.taobao.org

相关推荐
xiaofeichaichai2 小时前
Webpack
前端·webpack·node.js
问心无愧05132 小时前
ctf show web入门111
android·前端·笔记
唐某人丶2 小时前
模型越来越强,我们还需要 Agent 工程吗?—— 从价值重估到 Harness 实践
前端·agent·ai编程
智码看视界3 小时前
现代Web开发基础:全栈工程师的起航点
前端·后端·c5全栈
JS菌3 小时前
手写一个 AI Agent 全栈项目:从沙箱执行到子智能体的完整实现
前端·人工智能·后端
excel4 小时前
HLS TS 文件损坏的元凶:Git 提交与拉取
前端
Aphasia3114 小时前
https连接传输流程
前端·面试
徐小夕4 小时前
万字长文!千万级文档 RAG 知识库系统落地实践
前端·算法·github
threelab5 小时前
Three.js 物理模拟着色器 | 三维可视化 / AI 提示词
开发语言·前端·javascript·人工智能·3d·着色器