目录
一、问题描述
执行命令 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