create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

npx create-react-app

Open dinesh22js opened this issue 1 year ago • 10 comments

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

dinesh22js avatar Apr 15 '24 12:04 dinesh22js

use vite

nembenike avatar Apr 15 '24 19:04 nembenike

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

tejaswi-devalla avatar Apr 17 '24 07:04 tejaswi-devalla

Reinstall npm, and node

Horror, advice like “reinstall windows”

pefka avatar Apr 30 '24 11:04 pefka

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 avatar Apr 30 '24 11:04 niranjan404

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.

niranjan404 avatar Apr 30 '24 12:04 niranjan404

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

pefka avatar Apr 30 '24 12:04 pefka

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.

niranjan404 avatar Apr 30 '24 12:04 niranjan404

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)

pefka avatar Apr 30 '24 12:04 pefka

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.

niranjan404 avatar Apr 30 '24 12:04 niranjan404

  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)

devibala99 avatar May 19 '24 11:05 devibala99