[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:

  1. if using bash just run NODE_OPTIONS=--openssl-legacy-provider before any command

  2. adding 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 :

  1. Uninstall Nodejs 17.0.1
  2. Install it again Nodejs 16.13.0 version
  3. Start the server using "yarn serve"



Thank you for reading the article.