Skip to content

Error: ERR_OSSL_EVP_UNSUPPORTED while building with Nodejs 18.17.1 #50504

@madanbisht

Description

@madanbisht

Version

18.17.1

Platform

Mac, Unix, Windows

Subsystem

No response

What steps will reproduce the bug?

We are trying to upgrade with nodejs 18.17.1(which is required by https://releases.electronjs.org/release/v27.0.1, as we are trying to use electron 27.0.1 in our application) and facing the below error.

We tried to export below env variable and its solves the issue during code build but after that same error is reported when we launch the electron app.
export NODE_OPTIONS=--openssl-legacy-provider

python3 build/build.py                                           
> build
> webpack --env=prod --mode=production

Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
node:internal/crypto/hash:69
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (~/src/web/node_modules/webpack/lib/util/createHash.js:90:53)
    at NormalModule._initBuildHash (~/src/web/node_modules/webpack/lib/NormalModule.js:401:16)
    at handleParseError (~/src/web/node_modules/webpack/lib/NormalModule.js:449:10)
    at ~/src/web/node_modules/webpack/lib/NormalModule.js:481:5
    at ~/src/web/node_modules/webpack/lib/NormalModule.js:342:12
    at ~/src/web/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (~/src/web/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (~/src/web/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at ~/src/web/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (~/src/web/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at ~/src/web/node_modules/babel-loader/lib/index.js:51:71
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.18.2

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

There should not be any where while building the application.

What do you see instead?

we are facing error while building app with nodejs 18.17.1

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions