I found this solution https://github.com/webpack/webpack/issues/14532
-
if using bash just run
NODE_OPTIONS=--openssl-legacy-providerbefore any command -
adding
NODE_OPTIONS=--openssl-legacy-providerto package.json"scripts": { "start": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start", "build": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build" },
Edit
In my case, I’m using Nodejs 17.0.1 version and causing this error.
Firstly I’m using this command export NODE_OPTIONS=--openssl-legacy-provider before any command in GitBash Windows to fix this issue.
But, I think it’s not an efficient way, so what I do is :
- Uninstall Nodejs 17.0.1
- Install it again Nodejs 16.13.0 version
- I’m facing error another error when I start the server using “yarn serve” (another of my exiting Vuejs project), I don’t remember what is this, but after I run “yarn” and “yarn serve”, everything works now as I accept