32
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}


I get this error when i switched to node v18

John Driscoll
  • 365
  • 1
  • 2
  • 7
  • check out this it already has the solution [StackOverflow solution](https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported) – Kaddu Livingstone Dec 08 '22 at 06:19

4 Answers4

46

Here are two options now -

  1. Try to uninstall Node.js version 17+ and reinstall Node.js version 16+

You can re-install the current LTS Node.js version from their Official site. Or more specific downloads from here;

You can use NVM (Node Version Manager)

  • Linux and Mac users can use this nvm package link
  • Windows users can use this nvm package link
  1. Open a terminal and paste these as described:

Linux and macOS (Windows Git Bash)-

export NODE_OPTIONS=--openssl-legacy-provider

Windows command prompt-

set NODE_OPTIONS=--openssl-legacy-provider

Windows PowerShell-

$env:NODE_OPTIONS = "--openssl-legacy-provider"
20

Follow these steps on your terminal in the current app directory:

npm install -g npm-check-updates

Installs the npm-check-updates package globally for doing exactly what its name says.

ncu

This will display the dependencies side-by-side with (an arrow pointing to) their new versions (you are advised to upgrade to) as listed in your package.json file in the current directory.

ncu -u

This updates those new listed versions on your package.json file and prepares your app for the next step (the updates proper).

npm update

or

npm install

Either of these 2 finally installs the new updates; fixes the problem.


NB: I used

npm install

I ran into this issue with an old react.js app I cloned from github but did not want to downgrade to an older node version because I had just upgraded from node v14 to v18.13.0. Again, downgrading is not a security-smart option. Updates are there for numerous reasons; most times, "security reasons", especially in the JavaScript world.

Max Ralph
  • 511
  • 3
  • 9
19

Edit the package.json file with below changes:

"scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build"
 
  }
shirin niki
  • 323
  • 1
  • 3
0

The easiest solution that worked for me.

Mehedi
  • 281
  • 3
  • 5