Circle ci 2.0 yarn dependencies

We’re trying to get yarn install to correctly cache our dependencies. With the below config yarn runs every time as though there is no cache. Any ideas?

  • restore_cache:
    - ollieorder-app-yarn-v4-{{ checksum “yarn.lock” }}
    - run:
    name: Yarn Install
    command: yarn install --cache-folder ~/.cache/yarn --frozen-lockfile

    # Store yarn / webpacker cache
    - save_cache:
        key: ollieorder-app-yarn-v4-{{ checksum "yarn.lock" }}
          - ~/.cache/yarn

Hello @ryansdwilson

A strange behavior I have found with both NPM and YARN, the lock files are updated every time you run your install command. So if you have commited new code after running the install command, you will see you are also committing a new lock file, even if you have made no changes.

Could you try using your package.json file for the cache key instead? I’d also bump the version from v4 to v5 just in case.

Thanks for the info. Will let you know how it goes.