Home > Back-end >  How do I successfully create a new react app?
How do I successfully create a new react app?

Time:12-15

trying:

 npx create-react-app react

getting:

Need to install the following packages:

create-react-app

Ok to proceed? (y) y

You are running create-react-app 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:

  • npm uninstall -g create-react-app

  • yarn global remove create-react-app

The latest instructions for creating a new app can be found here:

https://create-react-app.dev/docs/getting-started/

following instructions try:

npm uninstall -g create-react-app

and get

up to date, audited 1 package in 217ms

found 0 vulnerabilities

Then I try to run the first command again and it never works.

When I run

npm ls -g --depth 0

I get

/usr/local/lib

├── [email protected]

├── [email protected]

└── [email protected]

I appreciate any help in advance!!

CodePudding user response:

Try one of the following

npx create-react-app@latest my-react-app
#or
npm create react-app@latest my-react-app

CodePudding user response:

With new documentation of React

Step 1: Run npm uninstall -g create-react-app

Step 2: Run npm install -g create-react-app

Step 3: Run npx create-react-app app-name

  • Related