简体   繁体   中英

How to fix npm ENOENT error in create-react-app?

I'm trying to create-react-app but it's showing error

I've tried

  • npm cache clean --force
  • npx create-react-app.

Also used this but same issue occurs

  • npm install -g create-react-app

can anyone suggest how to fix this?

npx is used for the libraries in node_modules in your project

Since you used -g (meaning global) to install create react app you should use

npm create-react-app

If you add create-react-app to your package json with

npm install create-react-app

you can then use npx to run the command.

Check if your create react app version is compatible with your machine's node version. Upgrade or downgrade accordingly to match the two. This fixed the issue at my machine.

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