简体   繁体   中英

npx create-react-app has suddenly stopped working

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.

Try clearing legacy-peer-deps

npx create-react-app myapp --legacy-peer-deps

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM