Hi guys, I hope you are doing fine. The main reason you landed on this page is the error: error:0308010c: digital envelope routines::unsupported Today, I was trying to run my react.js project and facing the same error.
Error: Error: 0308010C: digital in react.
Therefore, I worked out a bit and found possible solutions
So, here I will explain to you all the possible solutions.
Let’s start this article to solve this error without wasting any time.
How does this error occur?
I am just trying to run my react.js project and am facing the following error.
in new hash(node:internal/crypto/hash:67:19)
in Object.createHash(node:crypto:130:10)
How to solve error: error:0308010c:digital envelope routines::unsupported
To solve the error: error: 0308010C: in react error, You need to change the startup script in your package.json: start: react-scripts –OpenSSL-legacy-provider start Second solution: This problem occurs in the latest version node 17.0, but if you downgrade node, your error will be fixed. Just use the below command: install nvm 16.13.0. Your error has now been fixed.
Error: error: 0308010C: digital in react.js
To solve the error: error: 0308010C: unsupported in react error, You need to change the startup script in your package.json: start: react-scripts –openssl-legacy-provider start Second solution: This problem occurs in the latest version node 17.0, but if you downgrade node, your error will be fixed. Just use the below command: install nvm 16.13.0. Your error has now been fixed.
Solutions for error: error:0308010c:digital envelope routines::unsupported
- I have explained five possible solutions below to resolve the:
- error: 0308010C: digital envelope routines:: unsupported.
Solution 1. Modify package.json file
It would be best if you changed the start script in your package.json.
"start": "react-scripts start"
to
"start": "react-scripts --openssl-legacy-provider start"
Your error has now been fixed.
Solution 2: Downgrade Node
This issue occurs in the latest version of node 17.0, but if you downgrade the node, your error will be fixed. Just use the below command.
nvm install 16.13.0 #here put your required version
Your error has now been fixed.
Solution 3 – Use this command
Just run this command in the terminal.
export NODE_OPTIONS=--openssl-legacy-provider
Solution 4: Change the build script
It would help if you changed the build script to something like this in your package.json.
{
"scripts": {
"build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build"
}
}
Solution 5 – Use this command
Here’s the official message: If you hit the ERR_OSSL_EVP_UNSUPPORTED error in your app with Node.js 17, your app or the module you’re using is likely trying to use an algorithm or key size that is no longer allowed by default in OpenSSL 3.0. A new command line option, –OpenSSL-legacy-provider, has been added to fall back to the legacy provider as a temporary workaround for these tighter restrictions.
Just run this command in your terminal.
node --openssl-legacy-provider ./node_modules/.bin/gatsby build
Your error should now be resolved.
Conclusion:
That’s all about this question. I hope all solutions will help you a lot—comment below your thoughts and questions. Also, comment below on which solution worked for you.
GIPHY App Key not set. Please check settings