简体   繁体   中英

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'
    }

I'm a beginner at react-native
Kindly tell how can I resolve this

I encountered the same error, but for some reason switching node versions with nvm did not work. Removing nvm and using the system's node v16.5 solved the problem...

Try to downgrade your node . I usually downgrade to node v15.10.0 and it works.

What you can do:

  1. nvm install 15.10.0
  2. nvm use v15

install all your packages again expo , react-native , etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM