Diff nodejs version that I never installed

62 views Asked by At

When I type npm start I get this error:

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v21.2.0

But when I type node -v I get 20.9.0

I tried checking whether Node.js v21.2.0 exists. But no. Its added to PATH and everything but it still doesnt seem to work

1

There are 1 answers

1
Gigabit On

If you want to keep using a newer version of Node, you can use export NODE_OPTIONS=--openssl-legacy-provider and then run Node as normal. This is not hugely recommended but will work.

If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option, --openssl-legacy-provider, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions.

https://openjsf.org/blog/node-js-17-is-here

I believe this started from Node 17 onwards so another workaround would be to use an older version of Node than that, e.g. 16 but again this would not be hugely recommended.

Otherwise, you need to upgrade NPM and all packages you are using to versions that support OpenSSL v3. You can do this with npm audit fix --force but this may well break your build so it probably makes more sense to go through your packages manually and just update them to the latest versions that you can along with removing any that you don’t need. Most packages have long since been updated to support OpenSSL v3.