UNABLE_TO_GET_ISSUER_CERT_LOCALLY: request to https://registry.npmjs.org/abab failed, reason: unable

npm install 异常

前言

执行前端工程,在命令行 输入 npm install 报以下异常
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning UNABLE_TO_GET_ISSUER_CERT_LOCALLY: request to https://registry.npmjs.org/abab failed, reason: unable to get local issuer certificate npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation. npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! request to https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz failed, reason: unable to get local issuer certificate npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\psd\AppData\Roaming\npm-cache_logs\2024-06-06T13_23_34_866Z-debug.log D:\java_class\projectLearning\gmall-admin>npm install npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning UNABLE_TO_GET_ISSUER_CERT_LOCALLY: request to https://registry.npmjs.org/acorn failed, reason: unable to get local issuer certificate npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation. npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! request to https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz failed, reason: unable to get local issuer certificate npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\psd\AppData\Roaming\npm-cache_logs\2024-06-06T13_24_43_431Z-debug.log

问题描述

错误信息 “UNABLE_TO_GET_ISSUER_CERT_LOCALLY” 意味着 npm 无法获取本地证书颁发者的证书,可能导致无法建立安全的连接。

通常,这种情况发生在你的计算机或网络环境配置中存在一些问题,导致 npm 无法验证 npmjs.org 的证书。

问题解决

禁用 SSL 安全检查

npm config set strict-ssl false

喜欢我的文章的话,点个阅读或者点个点赞,是我编写博客的动力,持续更新中 ing…

  • 16
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值