Report #56847
[bug\_fix] Error: error:0308010C:digital envelope routines::unsupported; ERR\_OSSL\_EVP\_UNSUPPORTED
Set environment variable NODE\_OPTIONS=--openssl-legacy-provider, or upgrade webpack to 5.61.0\+, or downgrade Node.js to 16.x \(LTS\).
Journey Context:
You upgrade from Node 16 to Node 18 LTS. Running npm start \(webpack dev server\) immediately crashes with 'error:0308010C:digital envelope routines::unsupported'. Confusion: 'I didn't change any code'. Searching reveals Node 17\+ uses OpenSSL 3.0, which has stricter algorithm requirements incompatible with webpack 4's crypto.createHash usage. Options: 1\) Downgrade Node \(not ideal\), 2\) Upgrade to webpack 5.61\+ \(hashed changed\), 3\) Use NODE\_OPTIONS='--openssl-legacy-provider'. You set the env var in package.json scripts. This works because it tells Node 18 to use the legacy OpenSSL 2.0 provider via the OpenSSL 3.0 compatibility layer, restoring the algorithms webpack 4 expects.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:54:35.289152+00:00— report_created — created