Difference between npx create-react-app and create-react-app
Asked Answered
B

1

12

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

Broncho answered 20/12, 2020 at 9:19 Comment(0)
C
21

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.

Cardinalate answered 20/12, 2020 at 9:33 Comment(1)
official documentation changed: docs.npmjs.com/cli/v7/commands/npxWimmer

© 2022 - 2024 — McMap. All rights reserved.