1

I'm encountering an error when trying to run npm run start on my Node.js project. The error message I'm seeing is:

ex.js:59:103 { opensslErrorStack: ['error:03000086:digital envelope routines::initialization error'], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }

Node.js v19.8.1 ERROR: "front" exited with 1.

I've checked that the port is empty and no process is running, but the error persists. Can anyone help me understand what might be causing this error and how to fix it?

I tried to install nvm and install node 14.17 but still facing the same error

AmrShams07
  • 96
  • 1
  • 7
  • The OpenSSL nodejs uses depends on how it was built -- are you running a nodejs packaged for a Linux distro (which usually uses the distro's OpenSSL package) or Windows or docker (which uses an OpenSSL built into nodejs) or something else like homebrew on Mac or build from source? Anyway if your project is using obsolete crypto algorithms but you run on OpenSSL 3.0 or higher you need --openssl-legacy-provider . And this has nothing to do with any 'port'. – dave_thompson_085 Apr 07 '23 at 16:54

2 Answers2

12

Try to run that on your terminal before running starting command:

# linux
export NODE_OPTIONS=--openssl-legacy-provider
# windows
set NODE_OPTIONS=--openssl-legacy-provider
5

ERR_OSSL_EVP_UNSUPPORTED generally occurs when an application attempts to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. To fix this, you can upgrade Node.js to the latest LTS version or use the --openssl-legacy-provider option.

For Linux:

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

For Windows:

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

You may find these articles helpful.

  1. https://levelup.gitconnected.com/how-to-fix-the-err-ossl-evp-unsupported-error-in-node-js-197082f42185
  2. https://www.bswen.com/2021/11/reactjs-ERR_OSSL_EVP_UNSUPPORTED_error_solution.html
abhishek2046
  • 312
  • 1
  • 11