TypeScript & Node.js · Developer Error Resolution Lab
Fix Node.js 'error:0308010C:digital envelope routines::unsupported'
Resolve OpenSSL 3.0 cryptographic deprecation errors in Node.js 17+ when running Webpack 4 or legacy build tools.
Triggered Error Message:
Error: error:0308010C:digital envelope routines::unsupported (code: 'ERR_OSSL_EVP_UNSUPPORTED')
Customize Solution for Your Environment
# Option 1: Set environment variable before running
# Linux / macOS:
export NODE_OPTIONS=--openssl-legacy-provider
npm run build
# Windows (PowerShell):
$env:NODE_OPTIONS="--openssl-legacy-provider"
npm run build
# Option 2: Add cross-env to package.json
# npm install --save-dev cross-env
"scripts": {
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npm run build"
}Root Cause & Mechanism Analysis
Why does this error occur?
Node.js v17+ upgraded to OpenSSL 3.0, which deprecated legacy hashing algorithms (like MD4 used by older Webpack 4 plugins).
Frequently Asked Questions
Is --openssl-legacy-provider safe for production?
Related Developer Error Solutions
Browse All 35 GuidesTypeScript & Node.js
Webpack: Module parse failed
Configure appropriate loaders for TypeScript, JSX, CSS modules, or modern JavaScript syntax.
View fix guide
TypeScript & Node.js
Node.js: JavaScript heap out of memory
Increase V8 memory allocation using --max-old-space-size and identify memory leaks during builds.
View fix guide
TypeScript & Node.js
TS: Cannot find module or its type declarations
Resolve missing npm package types, misconfigured tsconfig path aliases, or missing declaration files.
View fix guide