npm install CERT_HAS_EXPIRED解决方法

目录


一、问题描述

执行命令 npm install 报错:

bash 复制代码
npm WARN registry Unexpected warning for https://registry.npm.taobao.org/: Miscellaneous Warning CERT_HAS_EXPIRED: request to https://registry.npm.taobao.org/js-cookie failed, reason: certificate has expired
npm WARN registry Using stale data from https://registry.npm.taobao.org/ due to a request error during revalidation.
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/js-beautify failed, reason: certificate has expired

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Program Files\nodejs\node_cache\_logs\2024-04-19T07_52_13_111Z-debug.log

二、问题原因

证书过期。

三、解决方法

临时忽略 SSL 证书校验:

bash 复制代码
npm set strict-ssl false
相关推荐
NorBugs16 小时前
飞机大战 Low 版 (Made in AI)
前端
angerdream17 小时前
Android手把手编写儿童手机远程监控App之agentweb如何实现全屏
前端
星栈17 小时前
10 分钟跑起第一个 Dioxus 应用:`dx` CLI、`rsx!` 和热更新好不好用
前端·rust·前端框架
奋斗吧程序媛17 小时前
补充一个小知识点:有关@click.native
前端·vue.js
触底反弹17 小时前
🚀 手把手用 HTML5 Canvas 从零打造飞机大战游戏,代码全开源!
前端·javascript·canvas
DJ斯特拉17 小时前
axios快速使用
开发语言·前端·javascript
还有多久拿退休金17 小时前
Ant Design Tree 搜索定位避坑指南:虚拟滚动下如何实现高亮与精准定位
前端·react.js
小月土星17 小时前
CSS 3D 从入门到炫技:手把手教你写一个旋转立方体
前端·css
智通17 小时前
Node.js事件循环核心机制
node.js
Hilaku18 小时前
AI 写代码越快,为什么 Code Review 越不能省?
前端·javascript·程序员