DEV Community

Cover image for opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]
Ann
Ann

Posted on

opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]

I ran into this error yesterday. My work computer is broken, so I had to clone my project into a new computer.
Finished setting up my new computer with a list of things: git, vscode, nvm, Nodejs 20,... I ran git clone, yarn install then yarn dev waiting for the magic to happen. But no something else came up

opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]

As a developer, I copied the line above and went on the internet. Started looking. There were a lot of suggestions:

  • Remove your node_modules and run yarn install again. I did, didn't work
  • Checking and switching node versions... wasn't even sure I was on Node20 so I also did, didn't work
  • a guy on Stackoverflow said add this script it might help: set SET NODE_OPTIONS=--openssl-legacy-provider that was surely the right thing to do, but not all to achieve the result that we want. So for me at the time, didn't work

Had to ask my colleague for help, he probably thinks I'm annoying but "Ego is the enemy" so I asked him to help debugging and you know what I missed?

In your vscode's terminal, run: yarn startDev
startDev script in my case is actually:
set NODE_ENV=development && set NODE_OPTIONS=--openssl-legacy-provider && concurrently \"nodemon server.js\"

So in conclusion, what I should have done or will do next time to fix this error is, step by step:

  • Clone the project
  • Yarn install
  • In package.json, add set NODE_OPTIONS=--openssl-legacy-provider
  • Don't forget to add && and spaces after the above script to separate it from other scripts in the same line
  • Should probably add the above script to scripts start, main, startServer, startDev if any.
  • Remember to run yarn startDev to seal the deal. Basically, this is the actual spell.
  • Finally, try running yarn dev to see if it works, because maybe your problem is different from mine and this is another "didn't work" suggestion.

Anyways, I hope you find your solution!
I am a noob, but you don't have to be one!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (1)

Collapse
 
aniruddhaadak profile image
ANIRUDDHA ADAK

wow amazing .

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay