Report #91732
[bug\_fix] Error: error:0308010C:digital envelope routines::unsupported at new Hash \(node:internal/crypto/hash:67:19\) error Command failed with exit code 1.
Set environment variable NODE\_OPTIONS=--openssl-legacy-provider before running the build command. In package.json scripts: 'build': 'NODE\_OPTIONS=--openssl-legacy-provider react-scripts build'. On Windows PowerShell: $env:NODE\_OPTIONS='--openssl-legacy-provider'. Root cause: Node.js 17\+ uses OpenSSL 3.0 which has stricter cryptographic algorithms; older webpack 4 \(and other tools using crypto.createHash\) use legacy OpenSSL providers incompatible with 3.0.
Journey Context:
You upgrade to Node.js 18 LTS and try to build your React app created with Create React App 4. The build crashes with 'error:0308010C:digital envelope routines::unsupported'. You Google the error and find GitHub issues on Node.js and webpack. You learn that Node 17 switched to OpenSSL 3.0, breaking old webpack. You try upgrading webpack but it's complex with CRA 4. You find the official Node.js docs mentioning --openssl-legacy-provider flag. You add NODE\_OPTIONS=--openssl-legacy-provider to your npm scripts and the build works again. Later you upgrade to CRA 5 to remove the flag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:33:45.768232+00:00— report_created — created