错误:03000086:数字信封例程::Vue.Js 项目上的初始化错误

ASH*_*lah 7 node.js vue.js

当我在终端中运行“npm runserve/build”语法时,我的 Vue 项目出现错误。

我的 npm 节点版本是 v18.12.0 (带有 npm 8.19.2)

错误信息是:

  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
Run Code Online (Sandbox Code Playgroud)

我尝试搜索解决方案,但很多解决方案都是针对 React 的,但它不起作用。

小智 2

只需用此替换您的脚本标签即可

"scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
}
Run Code Online (Sandbox Code Playgroud)