Symtom

  1. installed create-react-app as global module
    npm install -g create-react-app
    
  2. removed node_modules directory in project
    rm -rf node_modules
    
  3. tried to reinstall node_modules in project with package.json
    npm install
    
  4. 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

  1. uninstall globally installed CRA
    npm uninstall -g create-react-app
    
  2. install CRA as local package
    npm install create-react-app