close

[Solved] Error: error:0308010C:digital envelope routines::unsupported in reactjs

Hello Guys, How are you all? Hope You all Are Fine. Today I am just trying to run my reactjs project and I am facing following error Error: error:0308010C:digital envelope routines::unsupported in reactjs. 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 am just trying to run my reactjs project and I am facing following error.

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)

How To Solve Error: error:0308010C:digital envelope routines::unsupported in reactjs Error ?

  1. How To Solve Error: error:0308010C:digital envelope routines::unsupported in reactjs Error ?

    To Solve Error: error:0308010C:digital envelope routines::unsupported in reactjs Error You need to change start script in your package.json: “start”: “react-scripts –openssl-legacy-provider start” Second solution is This issue occurs in Node latest version 17.0 But If you downgrade node version will resolve your error. Just use below command: nvm install 16.13.0. Now your error solved.

  2. Error: error:0308010C:digital envelope routines::unsupported in reactjs

    To Solve Error: error:0308010C:digital envelope routines::unsupported in reactjs Error You need to change start script in your package.json: “start”: “react-scripts –openssl-legacy-provider start” Second solution is This issue occurs in Node latest version 17.0 But If you downgrade node version will resolve your error. Just use below command: nvm install 16.13.0. Now your error solved.

Solution 1: Change your package.json

You need to change start script in your package.json.

"start": "react-scripts start"

to

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

Now your error solved.

Solution 2: Downgrade node version

This issue occurs in Node latest version 17.0 But If you downgrade node version will resolve your error. Just use below command.

nvm install 16.13.0 #here put your required version

Now your error solved.

Solution 3: Use this command.

Just run this command in the terminal.

export NODE_OPTIONS=--openssl-legacy-provider

Solution 4: 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"
}
}

Solution 5: 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.

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

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment