skip to Main Content

When I create react app, I should first run the command "npm install create-react-app" then "npx create-react-app name", otherwise it will throw error, but others only need the the second command, Why?

I tried downloading latest version of node js, npm and clearing my cache but it still throw error when i try to run

npx create-react-app name

and still need to run npm install create-react-app.
Please help me to solve this problem.

2

Answers


  1. the create react app is deprecated. use

    npm create vite
    
    Login or Signup to reply.
  2. you should no longer need to install create-react-app globally. The recommended way to create a new React app is using the npx

    If you have previously installed create-react-app globally, it might be conflicting with the latest versions. Try uninstalling it: npm uninstall -g create-react-app

    You can clear the cache using: npm cache verify

    and lastly, you can create the app using: npx create-react-app@latest my-app

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search