# Error computing cache key: template

**URL:** <https://discuss.circleci.com/t/error-computing-cache-key-template/24233>\
**Category:** Build Environment\
**Tags:** nodejs, circle-yml\
**Created:** [August 10, 2018, 6:21pm UTC](https://discuss.circleci.com/t/error-computing-cache-key-template/24233 "2018-08-10T18:21:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yevheniiIvanise](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/yevheniiivanise/32/18833_2.png) [@yevheniiIvanise](https://discuss.circleci.com/u/yevheniiIvanise)\
**Post date:** [August 10, 2018, 6:21pm UTC](https://discuss.circleci.com/t/error-computing-cache-key-template/24233/1 "2018-08-10T18:21:19Z")

</div>

Hi,  
I am trying to setup save cache. But i get the following error:

> Error computing cache key: template: cacheKey:1:19: executing “cacheKey” at \<checksum "package.js…\>: error calling checksum: open /home/circleci/my-project/src/package.json: no such file or directory.

```
version: 2

machine:
    node:
        version: 8.9.4

jobs:
  build:
    docker:
      - image: circleci/node:8.9.4

working_directory: ~/my-project/src/

steps:
  - checkout:
      path: ~/my-project/src/

  - run:
      command: ls /home/circleci/my-project/src/

  - restore_cache:
      keys: v1-dependencies-{{ checksum "package.json" }}

  - run: npm install

  - save_cache:
      key: v1-dependencies-{{ checksum "package.json" }}
      paths:
        - "node_modules"

  - run: npm run lint

```

I tried to see if there is package.json file `ls /home/circleci/my-project/src/` and it shows another src folder inside this path `/home/circleci/my-project/src/`. I cannot understand this thing. I dont have any additional src folder inside this path.

---

<div class="post-metadata">

**Author:** ![levlaz](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/levlaz/32/36978_2.png) [@levlaz](https://discuss.circleci.com/u/levlaz)\
**Post date:** [August 12, 2018, 11:19pm UTC](https://discuss.circleci.com/t/error-computing-cache-key-template/24233/2 "2018-08-12T23:19:31Z")

</div>

Is there a specific reason why you are using the working\_directory arguments at all? If you leave all that stuff blank then it will just work based on the root of your repository. Try this:

```auto
steps:
  - checkout

  - run:
      command: ls /home/circleci/my-project/src/

  - restore_cache:
      keys: v1-dependencies-{{ checksum "package.json" }}

  - run: npm install

```

---

<div class="post-metadata">

**Author:** ![yevheniiIvanise](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/yevheniiivanise/32/18833_2.png) [@yevheniiIvanise](https://discuss.circleci.com/u/yevheniiIvanise)\
**Post date:** [August 13, 2018, 7:02am UTC](https://discuss.circleci.com/t/error-computing-cache-key-template/24233/3 "2018-08-13T07:02:49Z")

</div>

I tried and now i get this error message:  
ls: cannot access /home/circleci/my-project/src/ : No such file or directory  
Exited with code 2. I also tried to check the root of the project itself.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [November 11, 2018, 7:02am UTC](https://discuss.circleci.com/t/error-computing-cache-key-template/24233/4 "2018-11-11T07:02:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
