. Advertisement .
..3..
. Advertisement .
..4..
“Error: error:0308010C:digital envelope routines::unsupported” is a common error that shows up in many ways. What is the cause of it and how to solve it? Read on this article to find the best way to solve it.
When do you get the error “Error: error:0308010C:digital envelope routines::unsupported”?
When you run your program, you easily get the following warning message:
Error: error:0308010C:digital envelope routines::unsupported
How to solve the error “Error: error:0308010C:digital envelope routines::unsupported”?
Solution 1: Set the NODE OPTIONS environment variable
You can simply resolve the error “Error: error:0308010C:digital envelope routines::unsupported” by setting the NODE OPTIONS environment variable to —openssl-legacy-provider when executing your development server or converting the version of Node.js in you program to the LTS by issuing the installation of nvm –lts command.
First, the NODE_OPTIONS environment variable must be set to to –openssl-legacy-provider.
Run the following command after opening your terminal:
# Linux, macOS, or Windows Git Bash
export NODE_OPTIONS=--openssl-legacy-provider
# ----------------------------------------------------
# Windows CMD
set NODE_OPTIONS=--openssl-legacy-provider
Solution 2: Add openssl-legacy-provider parameter
Alternatively, you can issue the command in your package.json file with the —openssl-legacy-provider parameter added. Following is an instance of how to use create-react-app to do that.
{
"scripts": {
"start": "react-scripts --openssl-legacy-provider start"
}
}
If it does not work, try setting the environment variable NODE OPTIONS just before running the command.
{
"scripts": {
"dev": "NODE_OPTIONS=--openssl-legacy-provider next dev",
"build": "NODE_OPTIONS=--openssl-legacy-provider next build && next export",
}
}
The command in the package was only prefixed with NODE OPTIONS=—openssl-legacy-provider in a json script, such as NODE OPTIONS=—openssl-legacy-provider YOUR COMMAND HERE.
If it didn’t fix your problem, you need to run the node -v command and ensure that you are on the long-term supported version of Node.js. In the case you are using nvm, you can issue the command below:
nvm install --lts
The problem usuallly arises when installing the most recent Node version. Reverting to the version that is long-term supported fixes this issue.
When you use the most recent Node.js release, the —openssl-legacy-provider option is required since Node.js 17 and later use OpenSSL 3.0, which has undergone significant breaking changes.
The problem usuallly arises when installing the most recent Node version. Returning to the version that is long-term supported fixes this issue. When you use the most recent Node.js release, the —openssl-legacy-provider option is required since Node.js 17 and later use OpenSSL 3.0, which has undergone significant breaking changes.
Solution 3: Downgrade to the most recent stable release of Node.js
Another simple solution for the issue “Error: error:0308010C:digital envelope routines::unsupported” is to downgrade to the most recent stable release of Node.js (16.15.1 at the time of writing). Launch a terminal and enter the following command.
nvm install 16.15.1
Now try launching the project; it should build successfully. If you continue to receive the problem, try running this command to force the LTS version.
nvm use --lts
The above solutions are very simple, but they work flawlessly for you. They help you resolve your problem and your program will run well without any errors. So, what are you waiting without applying them for your problem? Let’s try them to get your desired results.
Conclusion
If the you get problem “Error: error:0308010C:digital envelope routines::unsupported” persists, let’s try the above remedies. If you need assistance or have other Java questions, many researchers are always keen to help. Finally, we hope all of our readers have a splendid day filled with new ideas.
Read more
→ Solve The Error: “Error: error:0308010C:digital envelope routines::unsupported in reactjs”
Leave a comment