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.

~/.npm is 1.2G on a new macos-latest hosted runner

See original GitHub issue

On the ubuntu-latest hosted runner ~/.npm doesn’t exist initially, as expected, but on the macos-latest hosted runner ~/.npm is 1.2G initially. This makes a cache restore or save take 1.5 minutes on macos-latest, verses seconds on ubuntu-latest.

2020-02-13T03:30:07.3173048Z ##[section]Starting: Request a runner to run this job
2020-02-13T03:30:07.3562194Z Requesting a hosted runner in current repository's account/organization with labels: 'macos-latest', require runner match: True
2020-02-13T03:30:07.7405114Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2020-02-13T03:30:07.7925180Z ##[section]Finishing: Request a runner to run this job
2020-02-13T03:30:23.3667460Z Current runner version: '2.164.0'
2020-02-13T03:30:23.3668900Z Prepare workflow directory
2020-02-13T03:30:23.3958520Z Prepare all required actions
2020-02-13T03:30:23.4418000Z ##[group]Run du -sh ~/.npm
2020-02-13T03:30:23.4418540Z du -sh ~/.npm
2020-02-13T03:30:23.6135780Z shell: /bin/bash -e {0}
2020-02-13T03:30:23.6136090Z ##[endgroup]
2020-02-13T03:30:25.5609940Z 1.2G	/Users/runner/.npm
2020-02-13T03:30:25.5653360Z Cleaning up orphan processes

Is the macos-latest npm cache being primed on purpose or did I find a bug?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

5reactions
smorimotocommented, Mar 1, 2020

You can also use such a configuration file as a temporary workaround.

name: Main workflow

on:
  push:
  pull_request:

jobs:
  build:
    strategy:
      matrix:
        os:
          - macos-latest
          - ubuntu-latest
          - windows-latest
        node-version:
          - 13.x

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Clean npm cache directory
        run: npm cache clear --force

      - name: Get npm cache directory
        id: npm-cache
        run: echo "::set-output name=dir::$(npm config get cache)"

      - name: Restore npm cache
        uses: actions/cache@v1
        with:
          path: ${{ steps.npm-cache.outputs.dir }}
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-

      - name: Install packages
        run: npm ci
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cache is large on macos-latest · Issue #427
On macOS, this directory is pre-populated with npm packages that ... ~/.npm is 1.2G on a new macos-latest hosted runner actions/cache#187.
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