Report #7302
[bug\_fix] error:0308010C:digital envelope routines::unsupported
Set environment variable NODE\_OPTIONS=--openssl-legacy-provider before running the build command \(e.g., NODE\_OPTIONS=--openssl-legacy-provider npm run build\). Root cause: Node.js 17\+ ships OpenSSL 3.0 which disables legacy algorithms \(MD4\) used by webpack 4's crypto.createHash; the flag re-enables the legacy provider.
Journey Context:
You upgrade to Node 18 for security patches. You run npm run build on a legacy React project using webpack 4 \(react-scripts 4\). It crashes with 'error:0308010C:digital envelope routines::unsupported' and a long OpenSSL stack trace. You search and find it's related to OpenSSL 3.0 in Node 17\+. You consider downgrading Node, but instead you try setting NODE\_OPTIONS=--openssl-legacy-provider. You export it in your shell, run the build again, and webpack 4's hashing now works. You add it to your package.json scripts permanently for the legacy project.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:19:21.606572+00:00— report_created — created