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
相关推荐
excel2 分钟前
Vue 中 v-if 与 v-for 的优先级及最佳实践(Vue2 / Vue3 对比)
前端
吃饭最爱12 分钟前
tomcat的功能和作用
前端
ObjectX前端实验室20 分钟前
【图形编辑器架构】:编辑器的 Canvas 分层事件系统
前端·canvas·图形学
真的想不出名儿2 小时前
登录前验证码校验实现
java·前端·python
小高0072 小时前
前端如何优雅地生成唯一标识?——一份跨环境 UUID 工具函数的封装与实战
前端·javascript·vue.js
云舟吖2 小时前
Playwright的元素定位器
前端
我是日安2 小时前
从零到一打造 Vue3 响应式系统 Day 24 - Watch:Options
前端·javascript·vue.js
浅浅的学一下2 小时前
实现在富文本中直接Ctrl+C复制图片并自动上传,并支持HTML格式的图片的复制
前端
wifi歪f2 小时前
🎨 探究Function Calling 和 MCP 的奥秘
前端·ai编程·mcp
BrendanDash2 小时前
React 19.2 已发布,现已上线 npm!
前端·react.js