新安装的node.js运行vue报错 解决node.js版本过高 error:03000086:digital envelope routines::initialization error

AddTime 2022/12/16 Hits 1391

1.问题原因

新安装的node.js跑之前的vue项目

2.错误描述

升级了node.js 版本到 v17.9.1,出现如下错误:

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'
}

3.解决办法

如果使用的是 visual studio code,在终端处输入

windows 输入

$env:NODE_OPTIONS="--openssl-legacy-provider"
或
set NODE_OPTIONS=--openssl-legacy-provider


小珂爱学习(XkWeb)
© 2020 Xkweb.cn. 小珂爱学习 让知识变得有趣 冀ICP备13014724号-2
Designed by:Xkweb3.6