反应本机错误:0308010C:数字信封例程::不支持

Posted

技术标签:

【中文标题】反应本机错误:0308010C:数字信封例程::不支持【英文标题】:React-native error:0308010C:digital envelope routines::unsupported 【发布时间】:2021-12-31 14:41:52 【问题描述】:

我不断收到ERR_OSSL_EVP_UNSUPPORTED错误,我在互联网上做了一些研究,我按照所说的做了,但是错误没有得到修复,可能是什么原因? json.package如下。




"name": "intelijReactNative",
  "version": "0.0.1",
  "private": true,
  "scripts": 
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "build": "react-scripts --openssl-legacy-provider build",
    "start": "react-scripts --openssl-legacy-provider start",
    "test": "jest",
    "lint": "eslint ."
  ,
  "dependencies": 
    "react": "17.0.2",
    "react-native": "0.66.3"
  ,
  "devDependencies": 
    "@babel/core": "7.16.0",
    "@babel/runtime": "7.16.3",
    "@react-native-community/eslint-config": "2.0.0",
    "babel-jest": "26.6.3",
    "eslint": "7.14.0",
    "jest": "26.6.3",
    "metro-react-native-babel-preset": "0.66.2",
    "react-test-renderer": "17.0.2"
  ,
  "jest": 
    "preset": "react-native"
  

错误如下

Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at stableHash (C:\Users\furka\Desktop\intelijReactNative\node_modules\metro-cache\src\stableHash.js:19:8)
    at Object.getCacheKey (C:\Users\furka\Desktop\intelijReactNative\node_modules\metro-transform-worker\src\index.js:593:7)
    at getTransformCacheKey (C:\Users\furka\Desktop\intelijReactNative\node_modules\metro\src\DeltaBundler\getTransformCacheKey.js:24:19)
    at new Transformer (C:\Users\furka\Desktop\intelijReactNative\node_modules\metro\src\DeltaBundler\Transformer.js:48:9)
    at C:\Users\furka\Desktop\intelijReactNative\node_modules\metro\src\Bundler.js:22:29
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processTimers (node:internal/timers:497:9) 
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

【问题讨论】:

这能回答你的问题吗? Error message "error:0308010C:digital envelope routines::unsupported" github.com/facebook/create-react-app/issues/11562 有详细信息,为什么要将 NodeJs 降级到 v16.13.0 【参考方案1】:

我有同样的错误。如果您使用的是 Node 版本 17+,它与一些 webpack 的东西还不兼容。 请改用 LTS 版本。在 v16.13.0

【讨论】:

成功了!谢谢。 @Ellon 我在运行此代码时发出npx react-native run-android --variant=release 出现错误,即使我从 16.14.0 降级到 16.13.0

以上是关于反应本机错误:0308010C:数字信封例程::不支持的主要内容,如果未能解决你的问题,请参考以下文章

本机动画模块不可用 - 反应本机

反应本机 Firebase 身份验证错误

需要未知模块“反应”的反应本机错误

将本机构建反应到设备失败

在模拟器/设备上/使用或不使用 Chrome 调试时反应本机行为不同

反应本机语法错误“,”