运行 命令 "npx react-native start" 后出错

Error after running the command "npx react-native start"

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\Anupam K Krishnan\Desktop\lcorn\myProject\node_modules\metro-cache\src\stableHash.js:19:8)
        at Object.getCacheKey (C:\Users\Anupam K Krishnan\Desktop\lcorn\myProject\node_modules\metro-transform-worker\src\index.js:593:7)
        at getTransformCacheKey (C:\Users\Anupam K Krishnan\Desktop\lcorn\myProject\node_modules\metro\src\DeltaBundler\getTransformCacheKey.js:24:19)
        at new Transformer (C:\Users\Anupam K Krishnan\Desktop\lcorn\myProject\node_modules\metro\src\DeltaBundler\Transformer.js:48:9)
        at C:\Users\Anupam K Krishnan\Desktop\lcorn\myProject\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'
    }

我是的初学者 react-native
请告诉我如何解决这个问题

尝试降级您的 node。我通常降级到 node v15.10.0 并且它有效。

你能做什么:

  1. nvm install 15.10.0
  2. nvm use v15

再次安装所有软件包 exporeact-native

我遇到了同样的错误,但出于某种原因,使用 nvm 切换节点版本不起作用。删除nvm并使用系统的节点v16.5解决了问题...