How to Fix error: 0308010c:digital envelope routines::unsupported

In the world of software development, encountering errors is a common occurrence. One such error that developers often come across is the “error: error:0308010c:digital envelope routines::unsupported.” This error message indicates an issue related to digital envelope routines, specifically an unsupported operation.

Fortunately, there are a couple of solutions that can help you resolve this error and continue with your Node.js development seamlessly. In this article, we will explore two possible solutions and guide you through the steps to implement them successfully.

Facing the ‘error:0308010c:digital envelope routines::unsupported‘ error in Node.js? Learn how to fix it by downgrading to Node.js v16 or enabling the legacy OpenSSL provider. Step-by-step instructions. Get back to seamless Node.js development.

How to Fix error: error:0308010c:digital envelope routines::unsupported?

Downgrade to Node.js v16

To address the error, one potential solution is to downgrade your Node.js version to v16. This can be done by following these steps:

  1. Visit the official Node.js website.
  2. Download the latest LTS (Long-Term Support) version of Node.js v16.
  3. Install the downloaded Node.js package on your system.
  4. Once the installation is complete, verify the Node.js version by running the following command in your command prompt or terminal:
    node -v

    • It should display the installed version as v16.x.x.
  5.  Now, you can proceed with your Node.js development without encountering the “error:0308010c:digital envelope routines::unsupported” issue.

By downgrading to Node.js v16, you ensure compatibility with the necessary digital envelope routines and eliminate the error.

By Enable legacy OpenSSL provider

Another solution to address the “error: error:0308010c:digital envelope routines::unsupported” error is to enable the legacy OpenSSL provider. The steps to enable this provider vary depending on your operating system. Follow the instructions relevant to your environment:

On Unix-like Systems

  1. Open your terminal application (e.g., Terminal on macOS).
  2. Execute the following command:
    export NODE_OPTIONS=–openssl-legacy-provider
  3. After executing the command, run your Node.js application again. The error should no longer appear.

Fix ”error:0308010c:digital envelope routines::unsupported” On Windows

Using Command Prompt

  1. Open the Command Prompt application.
  2. Enter the following command: set NODE_OPTIONS=–openssl-legacy-provider
  3. Run your Node.js application again to verify if the error has been resolved.

Using PowerShell

  1. Launch PowerShell.
  2. Execute the following command: $env:NODE_OPTIONS = “–openssl-legacy-provider”
  3. Run your Node.js application once more to check if the error persists.

Enabling the legacy OpenSSL provider ensures that the required digital envelope routines are supported, mitigating the occurrence of the error.

Conclusion

Resolving the error:0308010c:digital envelope routines::unsupported issue is crucial for smooth Node.js development. By either downgrading to Node.js v16 or enabling the legacy OpenSSL provider, you can overcome this error and continue building your applications without disruption.

Remember to choose the solution that suits your requirements and operating system. Now you are equipped with the knowledge to tackle this error effectively and optimize your Node.js development experience.

Leave a Comment