reactjs React Router:基于路由的组件渲染问题

dldeef67  于 12个月前  发布在  React
关注(0)|答案(1)|浏览(139)
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (D:\React Project\demoproject\demo\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\React Project\demoproject\demo\node_modules\webpack\lib\NormalModule.js:401:16)
    at handleParseError (D:\React Project\demoproject\demo\node_modules\webpack\lib\NormalModule.js:449:10)
    at D:\React Project\demoproject\demo\node_modules\webpack\lib\NormalModule.js:481:5
    at D:\React Project\demoproject\demo\node_modules\webpack\lib\NormalModule.js:342:12
    at D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:214:10) 
    at iterateNormalLoaders (D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:221:10) 
    at D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\React Project\demoproject\demo\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\React Project\demoproject\demo\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
D:\React Project\demoproject\demo\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (D:\React Project\demoproject\demo\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\React Project\demoproject\demo\node_modules\webpack\lib\NormalModule.js:401:16)
    at D:\React Project\demoproject\demo\node_modules\webpack\lib\NormalModule.js:433:10
    at D:\React Project\demoproject\demo\node_modules\webpack\lib\NormalModule.js:308:13
    at D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\React Project\demoproject\demo\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\React Project\demoproject\demo\node_modules\babel-loader\lib\index.js:51:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

字符串
如何解决这一
我使用了这个:npm install react-router-dom

dbf7pr2w

dbf7pr2w1#

您可以使用以下方法之一来解决此问题。
1.降级到Node v16。
你可以使用nvm。
1.启用旧版OpenSSL提供程序

export NODE_OPTIONS=--openssl-legacy-provider

字符串
1.更新OpenSSL

brew update
brew upgrade openssl

相关问题