Error:03000086:digital envelope routines::initialization error

Fix - error:0308010C:digital envelope routines::unsupported #

To solve the "error:0308010C:digital envelope routines::unsupported", set the NODE_OPTIONS environment variable to --openssl-legacy-provider when running your development server, or change your Node.js version to the LTS by issuing the nvm install --lts command.

Error:03000086:digital envelope routines::initialization error

The first thing you should try is set the NODE_OPTIONS environment variable to --openssl-legacy-provider.

Open your terminal and run the following command:

Copied!

# 👇️ macOS, Linux or Windows Git Bash export NODE_OPTIONS=--openssl-legacy-provider # ---------------------------------------------------- # 👇️ Windows CMD set NODE_OPTIONS=--openssl-legacy-provider

Alternatively, you can add the --openssl-legacy-provider flag when issuing the command in your package.json file.

Here is an example of how you would do that with create-react-app.

Copied!

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

If that doesn't help, try to set the NODE_OPTIONS environment variable right before issuing the command.

Make sure to update the command after the environment variable depending on your use case.

Copied!

{ "scripts": { "dev": "NODE_OPTIONS=--openssl-legacy-provider next dev", "build": "NODE_OPTIONS=--openssl-legacy-provider next build && next export", } }

If you run the command on Windows, you might get an error - "'NODE_OPTIONS' is not recognized as an internal or external command".

Install the cross-env package to solve the error.

Copied!

npm install cross-env

And prefix the environment variable and the command with cross-env.

Copied!

{ "scripts": { "dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider next dev", "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider next build && next export", } }

We simply prefixed the command in the package.json script with NODE_OPTIONS=--openssl-legacy-provider, e.g. NODE_OPTIONS=--openssl-legacy-provider YOUR_COMMAND_HERE.

If that didn't resolve your issue, run the node -v command and make sure you are running the long-term supported version of Node.js.

You can issue the following command if you use nvm:

The command will install and switch to the long-term supported version, which should resolve the issue.

The error often occurs when installing the latest version of Node. Rolling back to the long-term supported version solves it.

The --openssl-legacy-provider option is needed when using the latest version of Node.js, because Node.js 17 and later uses OpenSSL 3.0 which has had some breaking changes.

In this post, we will see How To Fix Error – “Digital Envelope Routines::Unsupported” in Node.js, React.js, Angular.js, Vue.js, Docker etc. Various facets of the error –

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
Error: digital envelope routines::unsupported
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
Error: digital envelope routines::unsupported
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'

The common reason for such issue is Version conflict issue or Version not in-sync with other entities in the system. Sometimes using latest Node.js might throw such error. Lot of projects still depend on Webpack 4 but the latest Node.js might not be compatible with that. Majorly this is caused by the latest Node.js Version compatible issues with OpenSSL.

if( aicp_can_see_ads() ) {

}

Check you node version

node -v

We will try out the below two options to see if that helps to fix the issue.

Option 1:

If you want to stick to your existing Node.js without down-grading it, then try the below steps –

if( aicp_can_see_ads() ) {

}

  • Use openssl-legacy-provider by setting it as an environment variable
    • Windows – Set below as environment variable
set NODE_OPTIONS=--openssl-legacy-provider
    • Mac\Linux – Set below in ~/.bash_profile or ~/.bashrc so that it stays even after you logout\login back.
export NODE_OPTIONS=--openssl-legacy-provider
    • For Docker – add the Highlighted bit in Dockekrfile
ENV NODE_OPTIONS=--openssl-legacy-provider

OR

RUN export NODE_OPTIONS=--openssl-legacy-provider && yarn build && yarn install
  • The openssl-legacy-provider parameter should be placed inside your package.json. Add the part highlighted in Red.
    • For Angular, use the below and then use npm start
"start": "set NODE_OPTIONS=--openssl-legacy-provider && ng serve -o"
    • For React, use the below in the package.json file.
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",
}

OR

"scripts": {
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
}
  • For Vue.js, use the below in the package.json file.
"scripts": {
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
},

OR

"scripts": {
"serve": "vue-cli-service --openssl-legacy-provider serve",
"build": "vue-cli-service --openssl-legacy-provider build",
"lint": "vue-cli-service --openssl-legacy-provider lint"
},
  • Also add something like the below Highlighted –
 "scripts": {

       "build": "NODE_OPTIONS=--openssl-legacy-provider npm run build:your-app:testing”,
       "build:your-app:testing": "NODE_OPTIONS=--openssl-legacy-provider ng build your-app 
                        --deploy-url https://your-app.com/ --configuration=test-config"

Another example –

if( aicp_can_see_ads() ) {

}

"scripts": {
    "dev": "NODE_OPTIONS=--openssl-legacy-provider nuxt"
}

Option 2:

At this point, I am assuming Option 1 somehow did not work out to fix the issue. The next option we can try is to roll-back to an older version of Node.js (STABLE) which is compatible with Webpack and doesn’t render this issue.

  • The version that you are using might not be compatible with some Webpack components.
  • Remove the current Node.js version and go-back i.e. Downgrade to an older Stable version. e.g. From Node.js 17+ go back to Node.js version 16+.
    • Windows – Uninstall node from the “Add or remove programs”. Alternatively use https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows to setup nvm and control Node version through it
nvm use <version>
    • Linux\Mac –
sudo n lts <------ To demote to the last LTS

OR

$ npm install -g n
$ n <VERSION_NO>

if( aicp_can_see_ads() ) {

}

  • Once done, cross check if node version is downgraded
$ node -v
  •  Delete the folder “node_modules” .
  • Re-install Node.js
    • Re-install the latest LTS node.js version from – https://nodejs.org/en/download/releases/
    • Alternatively use NVM package –
      • Linux\Mac – https://github.com/nvm-sh/nvm
      • Windows – https://github.com/coreybutler/nvm-windows
nvm instal lts

OR

nvm use lts

if( aicp_can_see_ads() ) {

}

  • Rebuild your project.

Hope this helps to solve the error.

Other Interesting Reads –

  • How to Update or Upgrade Gradle version in Android Studio?

  • How To Fix – “app:processDebugResources FAILED” in Android Studio ?

  • How To Fix – “Error: No Toolchains Found in the NDK Toolchains Folder” in Android ?

  • How To Fix – Error “ENOSPC: System Limit for Number of File Watchers Reached” ?

  • How To Fix – “Error: Unable To Find Utility “Instruments”, Not A Developer Tool or In PATH” ?

  • How to Fix – Uncaught TypeError: a.indexOf is Not a Function ?

  • How To Fix – Error “SDK location not found” in Android, React Native or Flutter ?

  • How to Send Large Messages in Kafka ?

  • Fix Spark Error – “org.apache.spark.SparkException: Failed to get broadcast_0_piece0 of broadcast_0”

  • How to Handle Bad or Corrupt records in Apache Spark ?

  • How to use Broadcast Variable in Spark ?

  • How to log an error in Python ?

if( aicp_can_see_ads() ) {

}

 error:0308010c:digital envelope routines::unsupported vue ,failed to construct transformer: error: error:0308010c:digital envelope routines::unsupported ,library: 'digital envelope routines', reason: 'unsupported', code: 'err_ossl_evp_unsupported' ,ganache cli digital envelope routines::unsupported ,opensslerrorstack: [ 'error:03000086:digital envelope routines::initialization error' ], ,error hh604: error running json-rpc server: error:0308010c:digital envelope routines::unsupported ,openssl digital envelope routines:inner_evp_generic_fetch:unsupported ,openssl error digital envelope routines ,digital envelope routines::unsupported angular ,error:0308010c:digital envelope routines::unsupported vue ,failed to construct transformer: error: error:0308010c:digital envelope routines::unsupported ,library: 'digital envelope routines', reason: 'unsupported', code: 'err_ossl_evp_unsupported' ,opensslerrorstack: [ 'error:03000086:digital envelope routines::initialization error' ], ,openssl digital envelope routines:inner_evp_generic_fetch:unsupported ,this[khandle] = new _hash(algorithm, xoflen); , , ,library 'digital envelope routines' ,library 'digital envelope routines' reason 'unsupported' code 'err_ossl_evp_unsupported' ,ng serve digital envelope routines unsupported ,node digital envelope routines ,node js digital envelope routines ,nodejs digital envelope routines unsupported ,npm digital envelope routines ,npm digital envelope routines unsupported ,npm run build digital envelope routines unsupported ,ntlm digital envelope routines evp_digestinit_ex disabled for fips ,openssl bad decrypt digital envelope routines ,openssl digital envelope routines evp_decryptfinal_ex bad decrypt ,digital envelope routines unsupported ,digital envelope routines ,digital envelope routines unsupported angular ,digital envelope routines initialization error ,digital envelope routines' reason 'unsupported' ,digital envelope routines evp_decryptfinal_ex bad decrypt ,digital envelope routines evp_digestinit_ex disabled for fips ,digital envelope routines unsupported webpack ,digital envelope routines err_ossl_evp_unsupported ,openssl digital envelope routines unsupported ,openssl error outputting keys and certificates digital envelope routines ,openssl error stack digital envelope routines ,openssl unable to load private key digital envelope routines ,paramiko valueerror digital envelope routines evp_digestinit_ex disabled for fips ,penpal envelope ideas ,python digital envelope routines evp_digestinit_ex disabled for fips ,python valueerror digital envelope routines evp_digestinit_ex disabled for fips ,react digital envelope routines unsupported ,storybook digital envelope routines unsupported ,unable to load private key digital envelope routines ,unsupported digital envelope routines ,valueerror digital envelope routines evp_digestinit_ex disabled for fips ,vue digital envelope routines unsupported ,webpack digital envelope routines unsupported ,what is digital envelope ,what is the envelope method ,yarn digital envelope routines unsupported ,yarn start digital envelope routines unsupported ,advantages of digital envelope ,angular digital envelope routines unsupported ,ansible digital envelope routines evp_digestinit_ex disabled for fips ,bad decrypt digital envelope routines ,config error digital envelope routines evp_digestinit_ex disabled for fips ,digital envelope routines ,digital envelope routines angular ,digital envelope routines bad decrypt ,digital envelope routines disabled for fips ,digital envelope routines err_ossl_evp_unsupported ,digital envelope routines error ,digital envelope routines evp decrypt final bad decrypt ,digital envelope routines evp_decryptfinal_ex bad decrypt ,digital envelope routines evp_decryptfinal_ex bad decrypt teraterm ,digital envelope routines evp_decryptfinal_ex wrong final block length ,digital envelope routines evp_digestinit_ex disabled for fips ,digital envelope routines evp_digestinit_ex disabled for fips paramiko ,digital envelope routines evp_pkey ,digital envelope routines initialization error ,digital envelope routines initialization error angular ,digital envelope routines inner_evp_generic_fetch ,digital envelope routines meaning ,digital envelope routines node js ,digital envelope routines not supported ,digital envelope routines openssl ,digital envelope routines questions ,digital envelope routines questions and answers ,digital envelope routines questions and answers pdf ,digital envelope routines quora ,digital envelope routines quotes ,digital envelope routines unsupported ,digital envelope routines unsupported angular ,digital envelope routines unsupported at new hash ,digital envelope routines unsupported err_ossl_evp_unsupported ,digital envelope routines unsupported in angular ,digital envelope routines unsupported nextjs ,digital envelope routines unsupported react ,digital envelope routines unsupported vue ,digital envelope routines unsupported webpack ,digital envelope routines unsupported windows ,digital envelope routines wrong final block length ,digital envelope routines xerox ,digital envelope routines xls ,digital envelope routines xlsx ,digital envelope routines xpath ,digital envelope routines zerodha ,digital envelope routines zerodha kite ,digital envelope routines zoho ,digital envelope routines zomato ,digital envelope routines' ,digital envelope routines' reason 'unsupported' ,digital envelope routines' reason 'unsupported' code 'err_ossl_evp_unsupported' ,digital organizer job description ,digital organizing ideas ,digital photo organization ideas ,digital transformation activities ,docker digital envelope routines unsupported ,err_ossl_evp_unsupported digital envelope routines ,error digital envelope routines evp_decryptfinal ,error digital envelope routines unsupported ,failed to construct transformer digital envelope routines ,how to create digital envelope ,ideas for cash envelope system ,j&t envelope size ,

if( aicp_can_see_ads() ) {

}