Reputation: 835
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
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
Reputation: 531
Just update your react-scripts package to latest version. It worked for me
npm i react-scripts@latest
Upvotes: 9
Reputation: 597
The easiest solution that worked for me.
nvm install <version>
. For my case, I had to downgrade from node v18 to v16. nvm install 16.20.2
nvm use 16
to use the older node version.Upvotes: 4
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
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
Reputation: 1594
Here are two options now -
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 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