Skip to main content
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?
It is safe as a temporary bridge, but upgrading Webpack / bundlers to modern versions using SHA-256 is the long-term solution.
Browse All 35 Guides