facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.22k stars 26.68k forks source link

npx create-react-app #13562

Open dinesh22js opened 2 months ago

dinesh22js commented 2 months ago

npx create-react-app This command is working very slowly Give me any Solution this problem

nembenike commented 2 months ago

use vite

tejaswi-devalla commented 2 months ago

Have you tried running it on wsl2? If you did and the issue still persists try updating your create-react-app package (or) delete it and reinstall it globally. Reinstall npm, and node

pefka commented 2 months ago

Reinstall npm, and node

Horror, advice like “reinstall windows”

niranjan404 commented 2 months ago

npx create-react-app This command is working very slowly Give me any Solution this problem

Change to vite; npx is not an faster one, tbh

https://www.linkedin.com/pulse/exploring-npx-create-react-app-vs-vite-choosing-right-amitha-h-hp4yf/ https://v3.vitejs.dev/guide/

niranjan404 commented 2 months ago

Have you tried running it on wsl2? If you did and the issue still persists try updating your create-react-app package (or) delete it and reinstall it globally. Reinstall npm, and node

Reinstalling won't solve this, npx cra is slow af since it uses webpack, and bundles the application before it makes ready to listen.

pefka commented 2 months ago

Change to vite; npx is not an faster one, tbh

There is no benchmark in your link, how much faster is 1%? by 2% by 10? some facts are needed, confirmed

I waited about 6 minutes and the installation went through npx, it just took a long time, but it was completed successfully

niranjan404 commented 2 months ago

Change to vite; npx is not an faster one, tbh

There is no benchmark in your link, how much faster is 1%? by 2% by 10? some facts are needed, confirmed

I waited about 6 minutes and the installation went through npx, it just took a long time, but it was completed successfully

Simply speaking, vite is quicker because it uses module preloading to achieve a faster build.

Read on to better understand with graphs: https://kinsta.com/blog/vite-vs-webpack/. More thorough explanations can be obtained.

Trust me, I was using npx cra Then, after switching to vite, production build and deploy times rose, as I saw.

pefka commented 2 months ago

Change to vite; npx is not an faster one, tbh

there is a link to compare VITE with WEBPACK, and we are talking about npx (NPX stands for Node Package eXecute. It is simply an NPM package runner)

niranjan404 commented 2 months ago

Change to vite; npx is not an faster one, tbh

there is a link to compare VITE with WEBPACK, and we are talking about npx (NPX stands for Node Package eXecute. It is simply an NPM package runner)

Well, I indeed know what npx is, since cra (create-react-app) uses webpack and NPX (Node package eXecute) runs the cra to initiate the app, it is mentioned as WEBPACK, basically it means the NPX.

If you wish, you can just initiate two new apps using vite and npx and watch which one builds quicker.

devibala99 commented 1 month ago
  1. When you run npx create-react-app command which bundles up the entire application code called WEBPACK written in JavaScript(Single threaded). The VITE will be the better option to use instead of npx command, because it uses ESbuild bundler which is written in Go language(Multi threaded).
  2. Instead of using npx create-react-app directly, consider cloning a boilerplate template: git clone https://github.com/facebook/create-react-app cd create-react-app yarn install yarn create react-app my-app (compared to npm yarn is much faster)