Error message "error:0308010C:digital envelope routines::unsupported"

Error message “error:0308010C:digital envelope routines::unsupported”

Sometimes, while using NodeJS packages you may get error message “error:0308010C:digital envelope routines::unsupported”. In this article, we will learn several things you can try to fix this problem.

Error message “error:0308010C:digital envelope routines::unsupported”

Here are a couple of things you can try to fix this problem.

1. Downgrade NodeJS to v16

First step is to uninstall NodeJS from your system and install NodeJS v16. Here is the link to its releases. Alternatively, you can use NVM for this purpose.

2. Enable Legacy OpenSSL Provider

Run the following command, depending on your system, to enable legacy OpenSSL Provider. You need to add this option when you start NodeJS server.

On Unix-like (Linux, macOS, Git bash, etc.):

export NODE_OPTIONS=--openssl-legacy-provider

On Windows command prompt:

set NODE_OPTIONS=--openssl-legacy-provider

On PowerShell:

$env:NODE_OPTIONS = "--openssl-legacy-provider"

3. For React Package

You may mostly get this error if you are using ReactJS package in NodeJS. In such cases, you can add the following line to package.json file of ReactJS package.

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

4. For NPM Users

If none of the above methods work or if you do not want to downgrade to Node v16, then you can try the following safe & secure way to fix the problem.

Use latest NodeJS version along with latest packages, and then run the following command to fix the problem.

$ npm audit fix --force

In many cases, when you use an outdated SSL package with security issues, along with latest NodeJS version, it causes problems.

In this article, we have learnt how to fix error message “error:0308010C:digital envelope routines::unsupported” while using NodeJS.

Also read:

How to Change Default Page in .htaccess
Apache Config File Location
How to Open, Extract RAR Files in Linux
How to Implement SSL/TLS in Apache Tomcat
How to Solve NPM Error ‘npm ERR! code ELIFECYCLE’

Leave a Reply

Your email address will not be published. Required fields are marked *