Report #65821
[bug\_fix] error:0308010C:digital envelope routines::unsupported \(OpenSSL 3.0 error in Node 17\+\)
Set the environment variable NODE\_OPTIONS=--openssl-legacy-provider before running the build command \(e.g., export NODE\_OPTIONS=--openssl-legacy-provider on Unix or set NODE\_OPTIONS=--openssl-legacy-provider on Windows\), or upgrade to webpack 5.61.0\+ / Next.js 12\+ / CRA 5\+ which include OpenSSL 3.0 compatible crypto. Root cause: Node.js 17\+ bundles OpenSSL 3.0 which disables legacy cryptographic algorithms like md4 by default; old webpack versions use crypto.createHash with md4 for chunk hashing, triggering the error.
Journey Context:
You upgrade to Node.js 18 \(LTS\) and suddenly npm start fails with 'error:0308010C:digital envelope routines::unsupported'. The stack trace points to crypto.createHash in webpack. You search and find OpenSSL 3.0 changed the default provider. You can either downgrade to Node 16, or set NODE\_OPTIONS=--openssl-legacy-provider to re-enable the legacy OpenSSL provider in Node.js, or upgrade webpack to 5.61.0\+ which replaced md4 with xxhash64. The legacy provider flag works because it tells OpenSSL to allow the obsolete md4 algorithm that old webpack relies on.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:57:31.850606+00:00— report_created — created