启动项目报错:Error: error:0308010C:digital envelope routines::unsupported

启动项目报错信息如下:

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/Users/xxxxxxx/node_modules/webpack/lib/util/createHash.js:90:53)
at NormalModule._initBuildHash (/Users/xxxxxxx/node_modules/webpack/lib/NormalModule.js:386:16)
at handleParseError (/Users/xxxxxxx/node_modules/webpack/lib/NormalModule.js:434:10)
at /Users/xxxxxxx/node_modules/webpack/lib/NormalModule.js:466:5
at /Users/xxxxxxx/node_modules/webpack/lib/NormalModule.js:327:12
at /Users/xxxxxxx/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/xxxxxxx/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/Users/xxxxxxx/node_modules/loader-runner/lib/LoaderRunner.js:221:10)

 

 

 

 

 

查看相关资料还是版本不匹配:

node v17中的OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响。在node v17以前一些可以正常运行的的应用程序,但是在 V17 版本可能会抛出以下异常

 

解决:

执行如下命令后,再次启动正常

1 export NODE_OPTIONS=--openssl-legacy-provider

 

 

参考博客:

https://blog.csdn.net/zp357252539/article/details/122559236

https://www.jianshu.com/p/58444afa75d6

posted @ 2022-08-24 11:37  菜小鱼~  阅读(8296)  评论(0编辑  收藏  举报