Build error on static deployment where previously it worked

Hi I’m seeing a new build error on two static websites that were previously fine.

A partial of the the build log and error:

...
Oct 21 12:35:35 PM  Run `npm audit` for details.
Oct 21 12:35:43 PM  ==> Using Python version: 3.7.10
Oct 21 12:35:46 PM  ==> Running build command 'npm run build'...
Oct 21 12:35:46 PM  
Oct 21 12:35:46 PM  > redacted-project-name@1.0.0 build
Oct 21 12:35:46 PM  > node build/build.js
Oct 21 12:35:46 PM  
Oct 21 12:35:47 PM  ** Detected branch HEAD **
Oct 21 12:35:47 PM  ** Detected branch HEAD **
Oct 21 12:35:47 PM  ** Detected branch specific environment configuration ** ./dev.env
Oct 21 12:35:48 PM  - building for production...
Oct 21 12:35:48 PM  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 (/opt/render/project/src/node_modules/webpack/lib/util/createHash.js:135:53)    at NormalModule._initBuildHash (/opt/render/project/src/node_modules/webpack/lib/NormalModule.js:414:16)    at handleParseError (/opt/render/project/src/node_modules/webpack/lib/NormalModule.js:467:10)    at /opt/render/project/src/node_modules/webpack/lib/NormalModule.js:499:5    at /opt/render/project/src/node_modules/webpack/lib/NormalModule.js:356:12    at /opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:373:3    at iterateNormalLoaders (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:214:10)    at iterateNormalLoaders (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:221:10)    at /opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:236:3    at runSyncOrAsync (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:130:11)    at iterateNormalLoaders (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:232:2)    at Array.<anonymous> (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:205:4)    at Storage.finished (/opt/render/project/src/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)    at /opt/render/project/src/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
Oct 21 12:35:50 PM  node:internal/crypto/hash:67
Oct 21 12:35:50 PM    this[kHandle] = new _Hash(algorithm, xofLen);
Oct 21 12:35:50 PM                    ^
Oct 21 12:35:50 PM  
Oct 21 12:35:50 PM  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 (/opt/render/project/src/node_modules/webpack/lib/util/createHash.js:135:53)    at NormalModule._initBuildHash (/opt/render/project/src/node_modules/webpack/lib/NormalModule.js:414:16)    at handleParseError (/opt/render/project/src/node_modules/webpack/lib/NormalModule.js:467:10)    at /opt/render/project/src/node_modules/webpack/lib/NormalModule.js:499:5    at /opt/render/project/src/node_modules/webpack/lib/NormalModule.js:356:12    at /opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:373:3    at iterateNormalLoaders (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:214:10)    at iterateNormalLoaders (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:221:10)    at /opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:236:3    at context.callback (/opt/render/project/src/node_modules/loader-runner/lib/LoaderRunner.js:111:13)    at /opt/render/project/src/node_modules/babel-loader/lib/index.js:59:71 {
Oct 21 12:35:50 PM    opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
Oct 21 12:35:50 PM    library: 'digital envelope routines',
Oct 21 12:35:50 PM    reason: 'unsupported',
Oct 21 12:35:50 PM    code: 'ERR_OSSL_EVP_UNSUPPORTED'
Oct 21 12:35:50 PM  }
Oct 21 12:35:50 PM  
Oct 21 12:35:50 PM  Node.js v17.0.1
Oct 21 12:35:50 PM  ==> Build failed 😞

I’m not sure if it’s something to do with Node.js v17 update but I’m unsure of how to fix or whether it’s something your side.

Many thanks

I can confirm it’s a problem with Node v17, when setting Node version in package.json or .node-version file to v16 it builds ok.

@Mike_Watts Happy to hear you were able to identify the issue. You can always specify a node version via one of the methods listed here: Specifying a Node Version | Render