状況
rails webpacker:compile
このコマンドを実行しようとした。
エラーログ
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:140:10)
at module.exports (/Users/***********/Desktop/rails_tuning_sample_app/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/***********/Desktop/rails_tuning_sample_app/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/***********/Desktop/rails_tuning_sample_app/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/***********/Desktop/rails_tuning_sample_app/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/***********/Desktop/rails_tuning_sample_app/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/***********/Desktop/rails_tuning_sample_app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/***********/Desktop/rails_tuning_sample_app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/Users/***********/Desktop/rails_tuning_sample_app/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /Users/***********/Desktop/rails_tuning_sample_app/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at context.callback (/Users/***********/Desktop/rails_tuning_sample_app/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at /Users/***********/Desktop/rails_tuning_sample_app/node_modules/babel-loader/lib/index.js:44:71 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
こんな感じのエラーが出た。
解決策
export NODE_OPTIONS=--openssl-legacy-provider
これで解決できた。