# Yarn Install freezes in circleci while it runs successfully when I SSH into the runner

**URL:** <https://discuss.circleci.com/t/yarn-install-freezes-in-circleci-while-it-runs-successfully-when-i-ssh-into-the-runner/51567>\
**Category:** Build Environment\
**Created:** [July 30, 2024, 10:50pm UTC](https://discuss.circleci.com/t/yarn-install-freezes-in-circleci-while-it-runs-successfully-when-i-ssh-into-the-runner/51567 "2024-07-30T22:50:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![meetmody01](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/meetmody01/32/35463_2.png) [@meetmody01](https://discuss.circleci.com/u/meetmody01)\
**Post date:** [July 30, 2024, 10:50pm UTC](https://discuss.circleci.com/t/yarn-install-freezes-in-circleci-while-it-runs-successfully-when-i-ssh-into-the-runner/51567/1 "2024-07-30T22:50:48Z")

</div>

#!/bin/bash -eo pipefail

# Install missing package when running on self host runner

yarn install  
1yarn install v1.22.19  
[1/4] Resolving packages…  
[2/4] Fetching packages…  
[3/4] Linking dependencies…  
[4/4] Building fresh packages…

Too long with no output (exceeded 10m0s): context deadline exceeded

Even with verbose same thing.

---

<div class="post-metadata">

**Author:** ![dhull](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dhull/32/35465_2.png) [@dhull](https://discuss.circleci.com/u/dhull)\
**Post date:** [July 31, 2024, 7:29pm UTC](https://discuss.circleci.com/t/yarn-install-freezes-in-circleci-while-it-runs-successfully-when-i-ssh-into-the-runner/51567/2 "2024-07-31T19:29:59Z")

</div>

I started having this exact same problem. Have not yet discovered a solution.

---

<div class="post-metadata">

**Author:** ![meetmody01](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/meetmody01/32/35463_2.png) [@meetmody01](https://discuss.circleci.com/u/meetmody01)\
**Post date:** [July 31, 2024, 8:08pm UTC](https://discuss.circleci.com/t/yarn-install-freezes-in-circleci-while-it-runs-successfully-when-i-ssh-into-the-runner/51567/3 "2024-07-31T20:08:03Z")

</div>

Actually

- removed puppeteer from dependency
- upgraded puppeteer to 22.x  
This got the yarn install to complete successfully but we have another issue but will be resolved

---

<div class="post-metadata">

**Author:** ![dhull](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dhull/32/35465_2.png) [@dhull](https://discuss.circleci.com/u/dhull)\
**Post date:** [July 31, 2024, 8:34pm UTC](https://discuss.circleci.com/t/yarn-install-freezes-in-circleci-while-it-runs-successfully-when-i-ssh-into-the-runner/51567/4 "2024-07-31T20:34:32Z")

</div>

Thanks for your reply! In fact “puppeteer” is one of my package’s dependencies as well, so it seems likely that the “yarn install” hang is somehow related to that.

I came back to share my hack workaround for the hang in the “Building fresh packages” step. This exits the “yarn install” early if it sees the “Building fresh packages” line.

```auto
      - run: |
          (yarn install --non-interactive &) |
          while read l; do
            echo ">$l"
            if [["$l" == *'Building fresh packages...'*]]; then
              sleep 4
              break
            fi
          done

```

---

<div class="post-metadata">

**Author:** ![dhull](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dhull/32/35465_2.png) [@dhull](https://discuss.circleci.com/u/dhull)\
**Post date:** [July 31, 2024, 9:32pm UTC](https://discuss.circleci.com/t/yarn-install-freezes-in-circleci-while-it-runs-successfully-when-i-ssh-into-the-runner/51567/5 "2024-07-31T21:32:58Z")

</div>

Upgrading puppeteer to version 22.13.1 also resolved the “yarn install” issue for me. Thanks!
