Skip to content

Fix: Error:03000086:digital envelope routines::initialization error

  • by
  • 2 min read
Top 7 games for kids to learn coding | Candid.Technology

As easy as Node.js to learn and use, it can be problematic at times, especially when dealing with algorithms and key size. The occasional bug and glitch out of the blue is nothing new for seasoned developers but the error codes can be rather confusing at times. 

In this article, we’re talking about the Error:03000086:digital envelope routines::initialization error, its causes and what can you do to fix the problem.


What causes the Error:03000086:digital envelope routines::initialization error?

The error is often triggered when using an incorrect encryption algorithm. However, other common factors include:

  • Using an unsupported padding method.
  • Unsupported key size. 
  • Using a missing or incorrect cryptographic key.

Also read: Error obtaining VCS status: Exit status 128: Quick Fix


How to fix Error:03000086:digital envelope routines::initialization error?

Here are three fixes you can try out.

Use legacy OpenSSL

The first and probably the easiest fix to the problem is to enable the openssl-legacy-provider flag to enable legacy algorithms and key sizes. To do so, use the flag in the start NPM script as follows.

NODE_OPTIONS=--openssl-legacy-provider npm run start

If you’re on Windows, use this instead.

set NODE_OPTIONS=--openssl-legacy-provider && npm run start

Finally, if you’re using React, update the start and build scripts in the package.json file.

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

Update Webpack

If updating packages didn’t work, a Webpack update might also be in order. First up, run the following command to check your existing Webpack version.

webpack --version

If the version is 4 or below, we need to update Webpack by running the following command

npm install [email protected]
What is Metadata? Types and benefits | Candid.Technology
Photo by Shahadat Shemul

Note that we’re using Webpack version 5.61.1. You can change this to whatever version is the latest at the time of the update. 


Update Node.js

Finally, updating Node.js itself can also resolve the issue. To do so, simply download and install the latest Node.js LTS version from the official website and you should be good to go. 

Also read: How to fix error in ./src/reportWebVitals.js: Can’t resolve ‘web-vitals’?

nv-author-image

Yadullah Abidi

Someone who writes/edits/shoots/hosts all things tech and when he's not, streams himself racing virtual cars. You can contact him here: [email protected]

>