System Information
- Strapi Version: 3.6.2
- Operating System: Heroku
- Node Version: That is the problem
Heroku decided today to run my two years old instance of Strapi with node 17 instead of 14, which does not work.
Here is the fix (in package.json
):
"engines": {
"node": "14.x",
},
This will ensure that Heroku runs it with the right version.
More details about it here Heroku Node.js Support | Heroku Dev Center
I will paste the full error just for SEO reasons:
node:internal/crypto/hash:67
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (/tmp/build_a4a873d1/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/tmp/build_a4a873d1/node_modules/webpack/lib/NormalModule.js:417:16)
at /tmp/build_a4a873d1/node_modules/webpack/lib/NormalModule.js:452:10
at /tmp/build_a4a873d1/node_modules/webpack/lib/NormalModule.js:323:13
at /tmp/build_a4a873d1/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /tmp/build_a4a873d1/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/tmp/build_a4a873d1/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at /tmp/build_a4a873d1/node_modules/babel-loader/lib/index.js:59:103
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v17.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed