【问题标题】:Whole MERN stack application will not start after changing MaterialUI icons更改 MaterialUI 图标后,整个 MERN 堆栈应用程序将无法启动
【发布时间】:2022-06-23 08:28:01
【问题描述】:

在 Git 上恢复到以前的版本后,我的应用程序仍然无法加载。这从来没有发生在我身上,无论我能够使用 Git 并恢复到我以前的版本,因为我喜欢经常提交。我不明白即使在那之后我怎么会得到这个错误。我正在创建一个 MERN 堆栈应用程序,这是我的错误。这发生在我从 MaterialUI 安装了一些删除图标之后。


Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/brandon/the_odin_project/bandmate/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/brandon/the_odin_project/bandmate/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/brandon/the_odin_project/bandmate/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
/home/brandon/the_odin_project/bandmate/client/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at /home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/NormalModule.js:452:10
    at /home/brandon/the_odin_project/bandmate/client/node_modules/webpack/lib/NormalModule.js:323:13
    at /home/brandon/the_odin_project/bandmate/client/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/brandon/the_odin_project/bandmate/client/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/brandon/the_odin_project/bandmate/client/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/brandon/the_odin_project/bandmate/client/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

我尝试替换“start”:“react-scripts start” 和 “开始”:“反应脚本--openssl-legacy-provider 开始” 并更换 “构建”:“反应脚本构建” 和 "build": "react-scripts --openssl-legacy-provider build"

在我的package.json 中看到这里,但它什么也没做。甚至没有错误,它只是永远加载页面。这是我在任何地方看到的唯一解决此错误的方法。

【问题讨论】:

  • 所以,这不仅仅是这个应用程序的问题,我之前使用 react 构建的所有其他应用程序都不再工作......这完全是奇怪的。

标签: node.js reactjs mongodb express


【解决方案1】:

这是 Node.js 放弃与 OpenSSL 1.1.1 的兼容性的问题。

使用 openssl-legacy-provider 选项运行,例如:

NODE_OPTIONS=--openssl-legacy-provider npm run watch

见https://github.com/nodejs/node/issues/40455

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-03
    • 1970-01-01
    • 2021-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多