当前位置:首页 > nodejs > 正文内容

error:0308010C:digital envelope routines::unsupported

关中浪子1年前 (2023-03-29)nodejs514
【腾讯云】2核2G4M云服务器新老同享99元/年,续费同价
找梯子最重要的就是稳定,这个已经上线三年了,一直稳定没有被封过,赶紧下载备用吧!

问题描述

使用 npm run dev 或者 yarn run dev 时报错:error:0308010C:digital envelope routines::unsupported


nodejs 版本为 18.12.1

39d0067c577338d92b0181584a1e4e2a_e3c03c71d54f4b8e97160b9d10feed2f.png



解决方案

Google 了一下发现是 Node JS 17 的 BUG,相关 ISSUE 也给出了解决办法,就是修改package.json,在相关构建命令之前加入set NODE_OPTIONS=--openssl-legacy-provider


"scripts": {
"dev": "set NODE_OPTIONS=--openssl-legacy-provider & node build/dev-server.js",
    "serve": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve",
    "build": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build",
    "build:report": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build --report",


例如,如果你使用的命令是npm run dev,那么就在 scripts 命令下的 dev 命令前面加


如果是 Linux 或者 WSL 环境,请加入 export NODE_OPTIONS=--openssl-legacy-provider



扫描二维码推送至手机访问。

版权声明:本文由码农翻生发布,如需转载请注明出处。

本文链接:https://lubojian.cn/post/232.html

分享给朋友:

相关文章

Please, upgrade your dependencies to the actual version of core-js.

core-js@2.6.12: core-js@❤️.3 is no longer maintained and not recommended for usage due to the number of issues. Because...

npm run dev 报错     Error: module property was removed from Dependency

npm run dev 报错 Error: module property was removed from Dependency

npm run dev  报错如下:Error: module property was removed from Dependency (use compilation.moduleGraph.updateModule(depe...

npm run dev ReferenceError: globalThis is not defined

请考虑将node.js的版本更新为>=12。globalThis已根据此兼容性表添加到node.js v12.0.0中。或者通过更新pm2解决npm install pm2 -gpm2 update...

Node Sass version 5.0.0 is incompatible with^4.0.0

在执行npm run dev 后项目报了 Node Sass version 5.0.0 is incompatible with^4.0.0 这个错误,很明显是Sass 的版本过高,因此需要对 Sass的版本降级为4.0版本。Sass 版...

EventSource 需要添加header等信息

一、原生EventSource(一)定义:MDN详解:Web API 接口参考>EventSource(二)使用方式:  const eventSource = new Ev...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。