Report #60018
[bug\_fix] Error: error:0308010C:digital envelope routines::unsupported
Set NODE\_OPTIONS=--openssl-legacy-provider environment variable, or upgrade to webpack 5 / latest babel-loader compatible with OpenSSL 3.0.
Journey Context:
Developer upgrades local Node.js from 16 LTS to 18 LTS \(or 17\+\). Clones an existing project using webpack 4, babel-loader, or old vue-cli. Runs npm start or npm run build. Gets "Error: error:0308010C:digital envelope routines::unsupported" with an OpenSSL error stack. The developer learns that Node 17\+ ships OpenSSL 3.0, which changed crypto provider behavior, breaking webpack 4's use of crypto.createHash. Immediate workaround: Run export NODE\_OPTIONS=--openssl-legacy-provider \(Linux/Mac\) or set NODE\_OPTIONS=--openssl-legacy-provider in Windows CMD/PowerShell before the command. This enables legacy OpenSSL provider in Node's crypto module. Permanent fix: Upgrade to webpack 5 \(which uses xxhash instead of crypto for hashing\) or upgrade babel-loader to versions compatible with OpenSSL 3.0. The developer opts to set the env var in package.json scripts: "build": "NODE\_OPTIONS=--openssl-legacy-provider webpack --mode production" \(cross-env for Windows compatibility\) while planning the webpack 5 migration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T07:13:38.261008+00:00— report_created — created