openssl Error Stack error : 03000086: digital envelope routines :: initialization error

11.7k views Asked by At
 opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
 library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
   }

  Node.js v19.5.0

i am getting this error in my nextjs project.

i don't want to downgrade my nodejs software version. Is there any other solution ?

4

There are 4 answers

0
Visual Sharp On BEST ANSWER

You are likely getting this error because you're using, (or one of the dependent packages is using) Webpack with a version of less than 5.

To check this run to check the Webpack version:

npm:

npm list webpack

or yarn

yarn list webpack

An example output could be. In this example I have Webpack 5 installed. But one of the dependency packages I'm using still has a reference to Webpack 4.

├─ [email protected]
│  └─ [email protected]
└─ [email protected]

The solution is to update the dependency package to the latest one that uses Webpack 5. If the dependency package's latest still using Webpack 4, then you might need to use install Node 16 instead.

0
Mohd Zubair Alam Ansari On

Just go to package.json file and add --openssl-legacy-provider to your start script like this:

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

Then npm start will work. if you have build then build it again and then npm start.

0
luislucena On

Another solution is to run this command in your terminal:

export NODE_OPTIONS=--openssl-legacy-provider
0
Ultiorra On

Already got this error in the past, the solution was to execute this:

npm install react-scripts@latest --legacy-peer-deps

Show more of your dependencies, if it doesn't work