解决nodejs报digital envelope routines::unsupported错误的方法

2023年1月1日 712点热度 0人点赞 0条评论
INFO  Starting development server...
10% building 2/5 modules 3 active ...Users/shellway/Downloads/red_bag/app/node_modules/babel-loader/lib/index.js!/Users/shellway/Downloads/red_bag/app/src/main.jsError: 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 (/Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/shellway/Downloads/red_bag/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/shellway/Downloads/red_bag/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

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 (/Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/shellway/Downloads/red_bag/app/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/Users/shellway/Downloads/red_bag/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/shellway/Downloads/red_bag/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/shellway/Downloads/red_bag/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /Users/shellway/Downloads/red_bag/app/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
解决办法:

支付 ¥2.99 购买本节后解锁剩余7%的内容

小小调酒师

此刻打盹,你将做梦; 此刻学习,你将圆梦。 个人邮箱:shellways@foxmail.com

文章评论