I recently worked on a Nuxt project and couldn’t build it because of a code: ‘ERR_OSSL_EVP_UNSUPPORTED’ error. I found out this is a common Node.js 17 problem that can also occur in Webpack-based projects in React, Next.js and Gatsby.

NODE.js ERR_OSL_EVP_UNSUPPORTED ERROR Explained

ERR_OSL_EVP_UNSUPPORTED is an error that occurs in Node.js 17 when your application or one of its modules attempts to use an algorithm or key size that’s no longer allowed by default in OpenSSL 3.0. You can fix it by either downloading the latest Node.js LTS version or using the --openssl-legacy-provider

Let’s learn what ERR_OSSL_EVP_UNSUPPORTED is and how to fix it.

More on Software EngineeringInstall Node.js: A Tutorial

 

What Is ERR_OSSL_EVP_UNSUPPORTED?

As mentioned in the Node.js 17 release notes, ERR_OSSL_EVP_UNSUPPORTED generally occurs when your application or one of its modules attempts to use an algorithm or key size that’s no longer allowed by default with OpenSSL 3.0.

Node.js 17 includes OpenSSL 3.0 for QUIC support. Even though OpenSSL 3.0 APIs should be mostly compatible with OpenSSL 1.1.1, there may be some issues with tightened restrictions on the algorithms and key sizes allowed. In other words, Node.js throws an ERR_OSSL_EVP_UNSUPPORTED error to prevent you from using a feature that OpenSSL removed for security reasons.

More on Software EngineeringGuide to the JavaScript Array Filter() Method

 

How to Fix the ERR_OSSL_EVP_UNSUPPORTED Error

There are two ways to fix the ERR_OSSL_EVP_UNSUPPORTED error:

  1. Upgrade Node.js by downloading and installing the latest Node.js LTS version.
  2. Use the --openssl-legacy-provider option.

If you can’t or don’t want to update your Node.js version, you can fix the problem with a workaround. Node.js 17 introduced the --openssl-legacy-provider command line option to revert to the legacy OpenSSL provider.

Use --openssl-legacy-provider in the startnpm script as follows:

NODE_OPTIONS=--openssl-legacy-provider npm run start

On Windows, it becomes:

set NODE_OPTIONS=--openssl-legacy-provider && npm run start

In React, update the start and build scripts in package.json with:

"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build"

Et voilà! Your application should now work like a charm.

A guide on how to fix Node.js “ERR_OSSL_EVP_UNSUPPORTED” Error. | Video: Huy Nguyen USA

ERR_OSSL_EVP_UNSUPPORTED is an annoying error. Addressing it isn’t difficult. You should now understand why Node.js 17 raises that error and how to fix it with the --openssl-legacy-provider command line option.

Expert Contributors

Built In’s expert contributor network publishes thoughtful, solutions-oriented stories written by innovative tech professionals. It is the tech industry’s definitive destination for sharing compelling, first-person accounts of problem-solving on the road to innovation.

Learn More

Great Companies Need Great People. That's Where We Come In.

Recruit With Us