DEV Community

B G Adam
B G Adam Subscriber

Posted on

2 2

npx create-react-app error

Today, I want make a react app with react cli:

npx create-react-app react-dapp
Enter fullscreen mode Exit fullscreen mode

Suddenly, this error comes:

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

We no longer support the 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/
Enter fullscreen mode Exit fullscreen mode

After some googling, several solutions appeared.

  • Solution 00

    • If you want to reinstall the create-react-app globally

      • using latest command

        npm install -g create-react-app@latest
        

      OR, if you already know which package version you’ll need to install

      • for example, create-react-app version 5.0.0

        npm install -g create-react-app@5.0.0
        
    • If you want to reinstall the create-react-app on the designated folder,

      go to the folder, open terminal, type:

      npx create-react-app@latest {project name} --use-npm
      

In most cases, the above solution didn't always straight working.

Try some of the options below:

  • Solution 1

    try to uninstall and reinstall it first.

    npm uninstall -g create-react-app
    
  • Solution 2

    If you run this in an older create-react-app version, try this to clear the npx cache:

    npx clear-npx-cache
    
  • Solution 3

    if you got the error:

    sh: 1: node: Permission denied
    

    on the root folder, you can type:

    npm config set user 0
    npm config set unsafe-perm true
    
  • Lastly, if you have broken npm/ yarn packages, go to the main folder and try to remove node_modules.

    For me, as I’m using Linux I just pressed ctrl + alt + t and typed:

    sudo rm -rf node_modules
    

    After that run this command if you are using yarn

    yarn install
    
    

    If you are using npm run this command

    npm install
    

    And check the solutions above, try from up to bottom.

Neon image

Build better on Postgres with AI-Assisted Development Practices

Compare top AI coding tools like Cursor and Windsurf with Neon's database integration. Generate synthetic data and manage databases with natural language.

Read more →

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay