close

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

Hello Guys, How are you all? Hope You all Are Fine. Today I just updated node to latest version and I am facing following error opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] in nodejs. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How this Error Occurs ?

I just updated node to latest version and I am facing following error.

Error: digital envelope routines::unsupported
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’

How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?

  1. How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?

    To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option--openssl-legacy-provider, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions. Just run this command in Your terminal. node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved.

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

    To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option--openssl-legacy-provider, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions. Just run this command in Your terminal. node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved.

Solution 1: Just use this command

Here is official Message : If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option--openssl-legacy-provider, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions.

Just run this command in Your terminal.

node --openssl-legacy-provider ./node_modules/.bin/gatsby build

Now your error must be solved.

Solution 2: change the build script

You should change the build script something like this in your package.json.

{
  "scripts": {
    "build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build"
  }
}

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

4 thoughts on “[Solved] opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]”

  1. Hi there! I recently got the exact error. But Neither solution one or two worked for me – I was getting: ./node_modules/.bin/gatsby module_not_found
    I solved the issue by downgrading node to the version the application was written in, a couple years ago. Honestly, if it would be in the docker container, we want have any of these errors at all .

    Reply

Leave a Comment