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

My current config.yml file looks like this:

  build-and-test-frontend:
    docker:
      - image: circleci/node:14
    steps:
      - checkout
      - restore_cache: ##
          name: Restore Yarn Package Cache
          keys:
            - 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" }}
          paths:
            - ~/.cache/yarn

and the structure of my project looks like this:

--project_root
 |
 |--frontend
    |-node_modules/
    |-public/
    |-src/
    |-tests/
    |-package.json
    |-yarn.lock

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.