question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Very slow to create an app / Size of created directory is huge

See original GitHub issue

Can you reproduce the problem with latest npm?

Yes, with current npm version of 4.0.3

Description

It is very slow to create a new app, on a decent connection (~800kB/s). Approximately 5 minutes.

I am teaching a course about React in University, and wanted the students to use CRA for easily getting started, however, for 50% of the students, the install time was so slow (more than 30 minutes), that I told them to use codepen instead. I also tried by giving them a USB stick of the created base folder, but it took an enormous amount of time to unzip the folder on their windows machines (30minutes, for > 60000 files apparently).

$ docker run test/cra-app du -hs 'foobaz'
114M    foobaz

The size of the created folder is of 114M, this seems extremely big, couldn’t we find a way to make this smaller ?

Expected behavior

The install to be faster / the directory size to be smaller

Actual behavior

The install is slow / the directory size is too big

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):

  2. node -v: 4.7.0

  3. npm -v: 4.0.3

  4. Operating system: Docker argon inside linux

  5. Browser and version: NA

Reproducible Demo

You can use this Dockerfile for reproducing :

FROM node:argon
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN npm install -g npm
# Install app dependencies
RUN npm install -g create-react-app
RUN create-react-app foobaz

If they is no way to reduce the time of download and size of an app for now, do you have an idea of how I could give my students a way to have their base directory when I’m in linux, and they are on windows, without internet connection ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
edi9999commented, Dec 11, 2016

Thanks for the quick and full response, I will tell students to use npm version 3 and do it before the next course. Indeed, the issues that you linked to are very revelant and it would be great to see them fixed.

0reactions
tirthaguhacommented, Jul 3, 2018

can this be re-opened? On node 8.11.3, npm 5.6.0, Win7, it took 2332s Creating a new React app in [PATH]\react-marionette-angular.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts…

uglifyjs-webpack-plugin@0.4.6 postinstall [PATH]\react-marionette-angular\node_modules\uglifyjs-webpack-plugin node lib/post_install.js

  • react@16.4.1
  • react-dom@16.4.1
  • react-scripts@1.1.4 added 1319 packages in 2332.344s

Success! Created react-marionette-angular at [PATH]\react-marionette-angular Inside that directory, you can run several commands:

It was much faster in npm 3.x, node 6.11.x win7

Read more comments on GitHub >

github_iconTop Results From Across the Web

npx create-react-app takes too long every time - Stack Overflow
Hard disks (mostly 5400RPM) ones bottleneck the I/O performance and thus causing installation process to slow down. Internet connectivity issues ...
Read more >
Create new folder takes too long - Microsoft Community
Recently, Windows Explorer has gone very slow when I try to create new folders. When I click on the "New Folder" icon or...
Read more >
How to Install Android Studio IDE & SDK and Get Started with ...
Android SDK (Software Development Kit) (about 5 GB) for developing and running Android apps. Step 1: Install "Android Studio IDE". Reference: "Install Android ......
Read more >
Troubleshoot known issues with Android Emulator
Alternatively, to work around this issue, set the environment variable ANDROID_SDK_HOME to a custom directory before creating an AVD. For ...
Read more >
Tuning - Spark 3.3.1 Documentation - Apache Spark
Formats that are slow to serialize objects into, or consume a large number of ... user can take to make more efficient use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found