Vue 打包 Error: error:0308010C:digital envelope routines::unsupported

这个错误通常与Node.js的加密模块和OpenSSL版本有关
出现这个错误是因为 node.js V17版本中最近发布的OpenSSL3.0, 而OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响.

js/app.8d066b51.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\terser-webpack-plugin\dist\index.js:217:37
    at Array.forEach (<anonymous>)
    at TerserPlugin.optimizeFn (D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\terser-webpack-plugin\dist\index.js:160:259)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\webpack\lib\Compilation.js:1409:36
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at D:\Projects\15.ithoth\01.SourceCode\Web\branches\V1.0.13\node_modules\webpack\lib\Compilation.js:1405:32

解决方案

image

image

如果CMD 发布,则在 Windows系统 增加环境变更
set NODE_OPTIONS=--openssl-legacy-provider
image

posted @   VipSoft  阅读(110)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
历史上的今天:
2021-06-11 Nacos 服务状态监听四种写发
2012-06-11 UML中的五种关系
点击右上角即可分享
微信分享提示