Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create-react-app is not working since version 4.0.1

I tried installing create-react-app using npm i create-react-app, npx create-react-app new-app and npm init react-app new-app, but I keep getting this error message:

You are running create-react-app 4.0.0, which is behind the latest release (4.0.1). We no longer support global installation of Create React App.

How can I fix this?

like image 869
Sumanth Hegde Avatar asked Nov 23 '20 07:11

Sumanth Hegde


People also ask

Why React app is not creating?

If you really need create-react-app , you might need to reinstall Node and reconfigure your dependencies to ensure you have a fresh start with Node, npm, npx, and the like.

Is create React app still supported?

Create-react-app no longer supported #12314 Please note that global installs of create-react-app are no longer supported. You can fix this by running npm uninstall -g create-react-app before using create-react-app again.

How do you fix 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?

To solve the React. js error "You are running create-react-app 4.0. 3, which is behind the latest release (5.0. 0)", run the npx clear-npx-cache command and re-run your app creation command, e.g. npx create-react-app my-app .

How do you fix we no longer support global installation of create React app?

Once you clear the npx or npm cache, you should be able to use create-react-app to create new applications again. And that's how you fix the We no longer support global installation of Create React App error.


7 Answers

This worked for me:

npx create-react-app@latest your-project-name --use-npm
like image 50
MeVimalkumar Avatar answered Oct 16 '22 23:10

MeVimalkumar


According to the create-react-app docs, create-react-app should not be installed globally:

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.

This is even stated in the error message you recieved:

You are running create-react-app 4.0.0, which is behind the latest release (4.0.1). We no longer support global installation of Create React App.

You must uninstall create-react-app with npm uninstall -g create-react-app.

Then each time you want to create a new React app with create-react-app, use the command npx create-react-app my-app.

So to fix the error you're getting, uninstall create-react-app globally, update npm, clear the cache, and retry creating the app.

Run this in your terminal:

npm uninstall -g create-react-app && npm i -g npm@latest && npm cache clean -f && npx create-react-app my-app
like image 20
Aryan Beezadhur Avatar answered Oct 16 '22 22:10

Aryan Beezadhur


I got

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.

so I simply called the package with an explicit version:

npx [email protected] app-name
like image 31
Eliya Cohen Avatar answered Oct 16 '22 22:10

Eliya Cohen


I also faced this issue after they released v4.0.2.

They have mentioned this:

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.

I resolved the issue by following the below steps:

  1. Uninstall create-react-app v4.0.1:

    # for npm:
    npm uninstall -g create-react-app
    
    # for yarn:
    yarn global remove create-react-app
    
  2. You are not required to install create-react-app in your local directory, so if you do not want to do this then move to step 3. If you want to do this, install v4.0.2 without using the global flag (-g or --global) using the below command:

    # for npm:
    npm i create-react-app
    
    # for yarn:
    yarn add create-react-app
    
  3. You can now create a new React app using the below command:

    # for npx:
    npx create-react-app my-app
    
    # for npm:
    npm init react-app my-app
    
    # for yarn:
    yarn create react-app my-app
    
like image 26
Jitesh Narula Avatar answered Oct 17 '22 00:10

Jitesh Narula


I also face the same problem but the problem gets solved when I uninstall the create-react-app globally and then again install it globally.

Uninstalling Command:

npm uninstall -g create-react-app

installing Command:

npx create-react-app my-app

if you have an older npm version (npm version < 5.2) then use this command :

npm install -g create-react-app

it solved my problem I hope it will solve yours

like image 16
co_ssm Avatar answered Oct 16 '22 23:10

co_ssm


Updating NPX worked for me. Suggestions on this page didn't do the trick but might have contributed.

npm update npx
like image 10
Fatherjacob Avatar answered Oct 17 '22 00:10

Fatherjacob


 npm uninstall -g create-react-app

Although the uninstall command ran successfully , it was not able to uninstall create-react-app, so i kept running into the same error again and again

This finally worked for me npx create-react-app@latest my-app --template typescript

like image 9
rookieCoder Avatar answered Oct 16 '22 23:10

rookieCoder