Report #7940
[bug\_fix] error:0308010C:digital envelope routines::unsupported or Error: error:03000086:digital envelope routines::initialization error
Set the environment variable \`NODE\_OPTIONS=--openssl-legacy-provider\` before running the command, or upgrade the build tool \(webpack 4→5, older vite, or vue-cli\) to a version compatible with OpenSSL 3.0. Root cause: Node.js 17\+ bundles OpenSSL 3.0 which disables legacy cryptographic algorithms \(MD4\) used by webpack 4's hash function for chunk IDs, causing the crypto createHash to fail.
Journey Context:
Developer upgrades to Node.js 18/20 on a legacy project using React Scripts 4 \(webpack 4\), Vue CLI 4, or old Next.js. Running \`npm start\` or \`npm run build\` immediately crashes with an OpenSSL error mentioning 'digital envelope routines' and 'unsupported'. Developer searches and finds advice to downgrade Node to 16 LTS, which works but is not sustainable. The real issue is that webpack 4 uses the MD4 hash algorithm for file naming, which OpenSSL 3.0 \(in Node 17\+\) has disabled by default for security. The immediate workaround is \`export NODE\_OPTIONS=--openssl-legacy-provider\` \(or set in package.json scripts on Windows\) which tells Node to enable the legacy OpenSSL provider. The proper fix is upgrading webpack to 5.61.0\+ \(which switched to xxhash64 or wasm hash\) or upgrading React Scripts/Vue CLI to versions supporting OpenSSL 3.0.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:11:32.622986+00:00— report_created — created