What is --openssl-legacy-provider in NPM?
Due to changes on Node.js v17, --openssl-legacy-provider was added for handling key size on OpenSSL v3. You somehow have installed the latest version of node.
- Restore your previous version of nodejs.
- Go and manually remove the node dependency(e.g. "node":17.4.3) from package.json and packagelock.json.
- Delete node_modules folder and use npm install to reinstall node_modules.
Related videos on Youtube
Meet Shah
Hey, I am a self-taught Java and Web developer. I have knowledge of Java, HTML, CSS and JavaScript. I know JavaFX and Swing Java GUI frameworks
Updated on June 04, 2022Comments
-
Meet Shah over 1 year
I was building a simple React app using Tailwind. I used create-react-app and then installed tailwind. I have done this many times before.
In order to install Tailwind, I also had to install craco and change package.json "scripts" to use craco, like so:
"scripts": { "start": "craco start", "build": "craco build", "test": "craco test", "eject": "react-scripts eject" }
However, this time, when I ran
npm start
, I got an error that I had never encountered before:Error: error:0308010C:digital envelope routines::unsupported
So I searched on StackOverflow and someone suggested adding
--openssl-legacy-provider
to my "start" script like this:"scripts": { "start": "craco --openssl-legacy-provider start", "build": "craco build", "test": "craco test", "eject": "react-scripts eject" }
And it's working now. But can somebody please explain to me what
--openssl-legacy-provider
actually is and how it works?-
CherryDT almost 2 years
-
Meet Shah almost 2 yearsBut why did it happen this time only and not usually? Do I have to do the same for all my projects in future?
-
Thomas Sablik almost 2 years"But why did it happen this time only and not usually?" Because some module uses commands that aren't supported anymore. "Do I have to do the same for all my projects in future?" Only when you use modules that use unsupported commands. I don't know why this commands aren't supported anymore and if it is related to security but using unsupported commands should be a red flag.
-
Meet Shah almost 2 yearsOh. Thanks a lot.
-