11

What is the difference between npx create-react-app and create-react-app?

React document says do npx creat-react-app but i see a tutorial in youtube and he say do create-react-app

I tried both of them and both work correctly

Krystian
  • 122
  • 1
  • 10

1 Answers1

20

npx will download the package create-react-app, run it once, then delete it from your disk. If you already have the package installed via npm install -g create-react-app, you can simply run create-react-app in your terminal.

It is recommended to use npx, because it doesn't clog up your filesystem, and because it will always use a package's latest version.

You can learn more from it on the official documentation.

hol
  • 8,255
  • 5
  • 33
  • 59
Jake
  • 2,090
  • 2
  • 11
  • 24