1
votes

I created a react project with the 'npx create-react-app my-app' command before and the 'my-app' folder contains this files and folders:

my-app
├── README.md
├── node_modules
├── package.json
├── .gitignore
├── public
│   ├── favicon.ico
│   ├── index.html
│   └── manifest.json
└── src
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── index.css
    ├── index.js
    ├── logo.svg
    └── serviceWorker.js
    └── setupTests.js

But now when I create a react project with the same command, the 'my-app' folder contains only 'node_modules' folder and 'package.json' 'yarn.lock' files.

my-app
├── node_modules
├── yarn.lock
└── package.json

I thought probably for using an outdated version of create-react-app, then to fix this, I did the following steps:

  1. Removing the old version of CRA by running npm rm -g create-react-app
  2. Installing the new version globally by running npm install -g create-react-app

But my issue still existed. The last thing that came to my mind was upgrading node.js from v10 to v12.16.3, but nothing didn't change.

1

1 Answers

0
votes

This problem occurred because there is global installs of create-react-app are no longer supported. For solving this problem, run these command respectively:

npm uninstall -g create-react-app

Then install create-react-app in this way

npm install create-react-app

Then create your react app

npx create-react-app my-app