How to fix error:0308010C:digital envelope routines::unsupported
A Mechanical Engineer and Software Engineer. I like to think of myself a FULL STACK ENGINEER. Psyche(:
CAUSES
NODE VERSION: Using Node version 17 and above,
Docker: Building with docker pulls the latest version of node.js by default {Node: LTS}.
The problem here is Node.js 17's push to use OpenSSL 3, changing the code required for the initialization context of the MD family.
HOW TO FIX
- Downgrade Node.js
You can use nvm (Node Version Manager) for your Os and run
nvm install 16.15.1nvm use 16.15.1While for docker you can directly supply the version of Node.js to use.
use Node:16.15.1
- Enable Legacy Support Get passed the error by enabling support for legacy OpenSSL versions.
Update ENV Variable
export NODE_OPTIONS=--openssl-legacy-providerUsing your terminal Run this on macOS, Linux, or Windows Git Bash.Updating the package.json file
"start": "react-scripts start"Update to:"start": "react-scripts --openssl-legacy-provider start"