apollo-universal-starter-kit icon indicating copy to clipboard operation
apollo-universal-starter-kit copied to clipboard

yarn add package is taking a long time ~12-15mins

Open pchakravarthy opened this issue 6 years ago • 7 comments

Describe the bug yarn add package is taking a long time ~12-15mins

To Reproduce Steps to reproduce the behavior:

  1. yarn add @babel/preset-flow @babel/cli is taking around ~18 mins to complete

Expected behavior Typically it should only take < 1 min to install this package. I suspect something is causing a delay. Does it install a fresh copy of all the packages?

This slows down development cycle as everytime we have a new package we wait for 20mins to start working

Screenshots N/A

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context

pchakravarthy avatar May 03 '19 20:05 pchakravarthy

cd packages'common yarn add @babel/preset-flow @babel/cli

info Direct dependencies
info All dependencies
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ [email protected]
└─ [email protected]
Done in 16.09s.

It has to do with your environment.

larixer avatar May 04 '19 06:05 larixer

Thank you @vlasenko for the quick response. I was trying to add these in the root folder as I was assuming that these are required by the project root.

pchakravarthy avatar May 04 '19 19:05 pchakravarthy

@pchakravarthy It doesn't matter, it is very quick too:

yarn add -WD @babel/preset-flow @babel/cli
info Direct dependencies
├─ @babel/[email protected]
└─ @babel/[email protected]
info All dependencies
├─ @babel/[email protected]
└─ @babel/[email protected]
$ opencollective postinstall

     *** Thank you for using apollo-universal-starter-kit! ***

Please consider donating to our open collective
     to help us maintain this package.

  https://opencollective.com/apollo-universal-starter-kit/donate

                    ***

Done in 13.10s.

larixer avatar May 05 '19 07:05 larixer

@pchakravarthy Hey Chakri! I've checked running docker on Mac, and I see some yarn performance degradation compared to running yarn on a Host, though not so great that you see:

/usr/src/app $ yarn add -WD @babel/cli
yarn add v1.3.2
Done in 135.15s.

I will ask in yarn support channel about this. Meanwhile could you make sure you use latest docker version?

larixer avatar May 08 '19 06:05 larixer

@pchakravarthy I have pushed some optimizations targeted at Docker on Mac into master branch. Could you check whether it improves things for you?

larixer avatar May 08 '19 19:05 larixer

@vlasenko thank you for the quick response, will check this out.

pchakravarthy avatar May 08 '19 20:05 pchakravarthy

You can try using pnpm as per your need for speed and optimization

yugkhokhar avatar Apr 07 '23 18:04 yugkhokhar