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:
- Visit the official Node.js website.
- Download the latest LTS (Long-Term Support) version of Node.js v16.
- Install the downloaded Node.js package on your system.
- Once the installation is complete, verify the Node.js version by running the following command in your command prompt or terminal:
- It should display the installed version as v16.x.x.
- 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
- Open your terminal application (e.g., Terminal on macOS).
- Execute the following command:
- 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
- Open the Command Prompt application.
- Enter the following command: set NODE_OPTIONS=–openssl-legacy-provider
- Run your Node.js application again to verify if the error has been resolved.
- Launch PowerShell.
- Execute the following command: $env:NODE_OPTIONS = “–openssl-legacy-provider”
- 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.
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.