[Solved] Getting error 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'
React JS
Safiul Tarek

Problem: Using Node JS 17 and getting this error during application start up using npm start command.
Getting error 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'
Solution 1:
if using bash just run
NODE_OPTIONS=--openssl-legacy-provider
before any commandadding
NODE_OPTIONS=--openssl-legacy-provider
to package.json"scripts": { "start": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start", "build": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build" },
Solution 2:
Using Nodejs 17.0.1 version and causing this error.
Try using LTS version instead, currently at 16.13.0.
So what we do is :
- Uninstall Nodejs 17.0.1
- Install it again Nodejs 16.13.0 version
- Start the server using "yarn serve"
Thank you for reading the article.