Im going to make your life soo much easier.. Instead of using gitbash or powershell commands, or even try to figure out what you did wrong to get this error.
If you are like me, this frustrated me.
What I did to fix this, was close everything associated with your coding build, programs like VSCode or any Windows 10 Explorer Folder windows you may have open.
Then go to your folder that you are having issues with, and delete the folder that says:
node_modules
Once you do, you are basically resetting everything you did wrong. And thats probably installing the wrong package that is some how magically conflicting with other modules you already have installed in VSCode.
Once you delete the folder, go back to your VSCode, open up your Terminal, and type:
npm install
or whatever installer you use, Yarn etc.
This will look into your package.json file in your app and look for the required modules you had for that package.
Now if you are still having that issue. Repeat this post again, but only after you open the package.json file and delete the modules you do or do not want. Like babel, or react-dom etc. before you run npm install
again. This way, you are removing the error(s) you made and tried fixing.
Hope this works for you.
Top comments (13)
I did below and it worked:
replace "start": "react-scripts start" by "start": "react-scripts --openssl-legacy-provider start"
replace "build": "react-scripts build" by "build": "react-scripts --openssl-legacy-provider build"
It worked! Thanks a lot :)
this worked! <3
youre a genius, this works ! thanks
This works perfectly, thanks :)
Thanks, this worked. :)
Thanks @saraarian your solution works perfect :)
where exactly did you replace this lines ?
your solution worked for me. Thank you!
Ily so much Sara
Thanks for your instruction. But I did what you said and it did not solve the issue. First I create the app, it would open and I can see the template of react app, but as soon as I delete the logo and the link so I can write my own app, I will get this error.
No it doesn't work don't delete node unless you need to downgrade to fit the requirements. click here for more stackoverflow.com/questions/747262...
Funciona, Gracias!