[Node] compute error when attempting to restore/save cache

My current config.yml file looks like this:

      - image: circleci/node:14
      - checkout
      - restore_cache: ##
          name: Restore Yarn Package Cache
            - v1-{{ checksum "yarn.lock" }}
      - run:
          working_directory: ./frontend
          name: Run jest tests
          command: |
            yarn install --frozen-lockfile --cache-folder ~/.
            yarn test
      - save_cache:
          name: Save Yarn Package Cache
          key: v1-{{ checksum "yarn.lock" }}
            - ~/.cache/yarn

and the structure of my project looks like this:


On restore_cache and save_cache steps, I get the following error:

error computing cache key: template: cacheKey:1:6: executing "cacheKey" at <checksum "yarn.lock">: error calling checksum: open /home/circleci/project/yarn.lock: no such file or directory

How can I fix this?

I answered this over on StackOverflow. It hasn’t been accepted yet so I don’t know if it was resolved yet.