0

I've been running 'npx create-react-app' for my projects for the last few months however today when I tried to run the command to create a new project I got this error:

Error Message

I've tried clearing my cache, running 'npx create-react-app@latest' with no luck so far.

samgwp
  • 1
  • Check out this answer. It describes indetail. [https://stackoverflow.com/questions/66239691/what-does-npm-install-legacy-peer-deps-do-exactly-when-is-it-recommended-wh](https://stackoverflow.com/questions/66239691/what-does-npm-install-legacy-peer-deps-do-exactly-when-is-it-recommended-wh) – Samitha Wijesekara Apr 12 '22 at 04:51

3 Answers3

0

Try clearing legacy-peer-deps

npx create-react-app myapp --legacy-peer-deps
Dharmik Patel
  • 1,041
  • 6
  • 12
0

I recently tried creating a new React project on React 18 with create-react-app and ran into this.

The following worked for me:

Open the project via vs code (or any other terminal) and run the npm install command again to install the dependencies:

npm install

If after running the above command, the same error still persists, try:

 npm install --legacy-peer-deps
Siddhant Varma
  • 574
  • 5
  • 10
0

It's a bug, we have to wait until the next update but you can try to install it and remove the node_module and after change the react-dom and react to a lower version like 17.0.2

thabe03
  • 1
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 12 '22 at 06:00