【Exception】npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

Talk is cheap, show me the code.

环境 | Environment

k version
OS windows 11
node v18.14.2
npm 9.5.0

报错日志 | Error log

复制代码
>npm create vite@latest
Need to install the following packages:
  create-vite@5.0.0
Ok to proceed? (y) y
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! request to https://cdn.npmmirror.com/packages/create-vite/5.0.0/create-vite-5.0.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\tanpenggood\AppData\Local\npm-cache\_logs\2023-11-22T02_46_11_530Z-debug-0.log

解决方案 | Solution

npm 项目中,发现类似的 [ISSUE #14667],并在 issue 的最后找到了解决方案。

复制代码
npm config set strict-ssl false

参考 | References

CSDN - 安装npm包的时候出现unable to get local issuer certificate的错误解决办法

https://github.com/npm/npm/issues/14667

https://docs.npmjs.com/misc/config

相关推荐
wyzqhhhh1 天前
组件库打包工具选型(npm/pnpm/yarn)的区别和技术考量
前端·npm·node.js
码上暴富1 天前
vue2迁移到vite[保姆级教程]
前端·javascript·vue.js
土了个豆子的1 天前
04.事件中心模块
开发语言·前端·visualstudio·单例模式·c#
全栈技术负责人1 天前
Hybrid应用性能优化实战分享(本文iOS 与 H5为例,安卓同理)
前端·ios·性能优化·html5
xw51 天前
移动端调试上篇
前端
@菜菜_达1 天前
Lodash方法总结
开发语言·前端·javascript
YAY_tyy1 天前
基于 Vue3 + VueOffice 的多格式文档预览组件实现(支持 PDF/Word/Excel/PPT)
前端·javascript·vue.js·pdf·word·excel
Yvonne爱编码1 天前
AJAX入门-AJAX 概念和 axios 使用
前端·javascript·ajax·html·js
在路上`1 天前
前端学习之后端java小白(三)-sql外键约束一对多
java·前端·学习
Pu_Nine_91 天前
10 分钟上手 ECharts:从“能跑”到“生产级”的完整踩坑之旅
前端·javascript·echarts·css3·html5