Symtom
- installed create-react-app as global module
npm install -g create-react-app - removed node_modules directory in project
rm -rf node_modules - tried to reinstall node_modules in project with package.json
npm install - node_modules directory is not appeared!!
Cause
If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.
from https://create-react-app.dev/docs/getting-started/
Solution
- uninstall globally installed CRA
npm uninstall -g create-react-app - install CRA as local package
npm install create-react-app