warning: the transform cache was reset. Welcome to Metro! Fast - Scalable - Integrated
To reload the app press "r" To open developer menu press "d"
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:79:19) at Object.createHash (node:crypto:139:10) at stableHash (/Users/mac/.../PluginReact/node_modules/metro-cache/src/stableHash.js:19:8) at Object.getCacheKey (/Users/mac/.../PluginReact/node_modules/metro-transform-worker/src/index.js:593:7) at getTransformCacheKey (/Users/mac/.../PluginReact/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:24:19) at new Transformer (/Users/mac/.../PluginReact/node_modules/metro/src/DeltaBundler/Transformer.js:48:9) at /Users/mac/.../PluginReact/node_modules/metro/src/Bundler.js:22:29 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error', 'error:0308010C:digital envelope routines::unsupported' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }
这个报错其实是Node.js版本和OpenSSL默认配置不兼容导致的,常见在Node 17+或者Node 18下跑React Native / Metro bundler的时候。