Today when I was trying to start a Node script, I had the following error:
1 | Error: error:0308010C:digital envelope routines::unsupported |
The error comes from a dependency relying on an obsolete version of SSL, so you have a couple of options:
- Downgrade to Node.js v16.
- Tell Node to use the legacy OpenSSL provider
Downgrade Node.js to v16 (Not recommended)
You can downgrade Node itself so that you’re using a version that uses the old, insecure, version of LibSSL. That doesn’t “solve” the problem of running insecure and potentially exploitable code, of course, but your code will at least run.
(You can either do that using the official Node installers, or you can use something like nvm. For Windows, use nvm-windows.)
Tell Node to use the legacy OpenSSL provider
In your package.json: change this line
1 | "start": "react-scripts start" |
to
1 | "start": "react-scripts --openssl-legacy-provider start" |
Sources: