John Driscoll
John Driscoll

Reputation: 835

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ]

  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

Upvotes: 77

Views: 225644

Answers (6)

Sandra Sajeev
Sandra Sajeev

Reputation: 39

Kindly replace

"start": "react-scripts start"

by

"start": "react-scripts --openssl-legacy-provider start"

and

"build": "react-scripts build"

by

"build": "react-scripts --openssl-legacy-provider build"

Upvotes: 0

Prakash Upadhyay
Prakash Upadhyay

Reputation: 531

Just update your react-scripts package to latest version. It worked for me

npm i react-scripts@latest

Upvotes: 9

Mehedi
Mehedi

Reputation: 597

The easiest solution that worked for me.

Upvotes: 4

shirin niki
shirin niki

Reputation: 823

Edit the package.json file with below changes:

"scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build"
 
  }

Upvotes: 69

Max Ralph
Max Ralph

Reputation: 721

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.

Upvotes: 37

Kaddu Livingstone
Kaddu Livingstone

Reputation: 1594

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"

Upvotes: 119

Related Questions