黔南州住房和城乡建设局网站,软件开发过程五个步骤,移动端网站开发标题设置,广东省城乡和建设厅网站目录
问题描述#xff1a;error:03000086:digital envelope routines::initialization error
问题原因#xff1a;nodejs V17 版本发布了 OpenSSL3.0 对算法和秘钥大小增加了更为严格的限制#xff0c;nodeJs v17 之前版本没影响#xff0c;但 V17 和之后版本会出现这个错…目录
问题描述error:03000086:digital envelope routines::initialization error
问题原因nodejs V17 版本发布了 OpenSSL3.0 对算法和秘钥大小增加了更为严格的限制nodeJs v17 之前版本没影响但 V17 和之后版本会出现这个错误。
解决方案
方法一Vscode或者cmd命令行输入命令
方法二 vue前端项目命令框输入npm run serve或者npm run dev
报error:03000086:digital envelope routines::initialization error错误
Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:69:19) at Object.createHash (node:crypto:133:10) at module.exports (D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\webpack\lib\NormalModule.js:471:10) at D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\webpack\lib\NormalModule.js:503:5 at D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\webpack\lib\NormalModule.js:358:12 at D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at Array.anonymous (D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\loader-runner\lib\LoaderRunner.js:205:4) at Storage.finished (D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16) at D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9 at D:\Code\VueProject\iss-edu-platform-online-front-all\node_modules\graceful-fs\graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { opensslErrorStack: [ error:03000086:digital envelope routines::initialization error ], library: digital envelope routines, reason: unsupported, code: ERR_OSSL_EVP_UNSUPPORTED }
Node.js v18.17.1 问题描述
由于重装了系统node.js全部重新安装目前node.js 版本为 18.7.1部分老项目在使用时报错 opensslErrorStack: [ error:03000086:digital envelope routines::initialization error ],library: digital envelope routines,reason: unsupported,code: ERR_OSSL_EVP_UNSUPPORTED
问题原因
NodeJs V17 版本发布了 OpenSSL3.0 对算法和秘钥大小增加了更为严格的限制nodeJs v17 之前版本没影响但 V17 和之后版本会出现这个错误。老项目是nodeJS16版本。
解决方案
由于版本差异为了适配老项目最好的方案就是退回旧版本。但技术总在迭代更新为此我选择了停留在当前版本简单直接的解决问题。
方法一Vscode或者cmd命令行输入命令
$env:NODE_OPTIONS--openssl-legacy-provider 使电脑上的 node 版本能适应项目的版本。
然后再执行 npm run serve 则能成功运行项目。 方法二
找到package.json 文件加上set NODE_OPTIONS--openssl-legacy-provider 如下
dev: set NODE_OPTIONS--openssl-legacy-provider vue-cli-service serve --open, 就我个人而言方法一是比较好推荐大家使用方法一。省的每个项目都要配置一下。