reactjs “错误:错误:0308010C:数字信封例程::不支持”节点版本错误

5cg8jx4n  于 2023-10-17  发布在  React
关注(0)|答案(1)|浏览(151)
Starting the development server...

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 (C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Rohit\New folder\react-blogs\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Rohit\New folder\react-blogs\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Rohit\New folder\react-blogs\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
C:\Rohit\New folder\react-blogs\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

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 (C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\NormalModule.js:417:16)
    at C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\NormalModule.js:452:10
    at C:\Rohit\New folder\react-blogs\node_modules\webpack\lib\NormalModule.js:323:13
    at C:\Rohit\New folder\react-blogs\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Rohit\New folder\react-blogs\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Rohit\New folder\react-blogs\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Rohit\New folder\react-blogs\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'
}

Node.js v18.18.1

当我做这个应用程序的节点LTS版本是节点16现在它18当我执行npm start它给了我这个节点版本错误,我也执行npm update --force它更新了所有文件,然后太相同的错误显示在终端。解决这个问题的办法是什么呢?我如何才能重新启动reat应用程序

hlswsv35

hlswsv351#

你有两个选择再次将node版本降级到16,或者

快速修复

在类Unix(Linux、macOS、Git bash等)上:
export NODE_OPTIONS=--openssl-legacy-provider
在Windows CMD上:
set NODE_OPTIONS=--openssl-legacy-provider
在PowerShell上:
$env:NODE_OPTIONS = "--openssl-legacy-provider"

相关问题