Hey there! I’m currently trying to use caching to reduce the amount of time installing dependencies takes in my builds, but I’m seeing that even with caching implemented as suggested, yarn install
is still taking ~1 minute, which is quite long, considering the restore_cache step is saying that it found an applicable cache. Does anyone see anything specifically wrong with my caching setup here?
Here’s my config: (these are steps in my main test build job)
- restore_cache:
name: Restore yarn package cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install node modules
command: yarn install --frozen-lockfile
- save_cache:
name: Save yarn package cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
and then yarn outputs:
#!/bin/bash -eo pipefail
yarn install --frozen-lockfile
yarn install v1.22.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
<various peer dependency warnings>
e.g.
warning " > babel-loader@8.0.6" has unmet peer dependency "webpack@>=2".
[4/4] Building fresh packages...
Done in 50.98s.
CircleCI received exit code 0
The cause of it taking 51 seconds eludes me! Locally, it takes 0.6s, so I thought it might be yarn’s internal registry cache, but even after clearing that with yarn cache clear
, it was the same time. Am I missing something? I’d like to be able to knock a full minute off my build if possible. Let me know if whoever reads this needs more information as well, but I think this should be all of the pertinent config/logs.