reactjs 当我在创建'npx create-react-app my-app'之后执行'npm install'时,当我启动应用程序'npm start`时,它会给我错误

hrirmatl  于 2023-01-08  发布在  React
关注(0)|答案(1)|浏览(147)
Severity: moderate
Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\NormalModule.js:401:16)      
    at handleParseError (D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\NormalModule.js:449:10)
    at D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\NormalModule.js:481:5
    at D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\NormalModule.js:342:12
    at D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:214:10)       
    at iterateNormalLoaders (D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:221:10)       
    at D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:232:2)        
    at Array.<anonymous> (D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\extras\meet up app with react\meet-up\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\extras\meet up app with react\meet-up\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
D:\extras\meet up app with react\meet-up\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\util\createHash.js:90:53)
    at NormalModule._initBuildHash (D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\NormalModule.js:401:16)
    at D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\NormalModule.js:433:10
    at D:\extras\meet up app with react\meet-up\node_modules\webpack\lib\NormalModule.js:308:13
    at D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\extras\meet up app with react\meet-up\node_modules\loader-runner\lib\LoaderRunner.js:111:13)     
    at D:\extras\meet up app with react\meet-up\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'
}

节点. js版本18.10.0
我已尝试再次安装node_moduls和npm audit fix --force

neekobn8

neekobn81#

卸载并重新安装React脚本
1.打开终端并运行npm uninstall react-scripts
1.运行npm install react-scripts
手动更改React脚本版本
1.转到您的package.json并将react-script版本更改为5.0.2
1.通过运行rm –rf node_modules删除node_modules文件夹
1.通过运行rm –rf package.lock.json删除package.lock.json文件
1.运行npm install

相关问题