Local tests pass - on circle CI I get a module not found error

In my builds, I run local tests and everything passes.
When I run the build process on circleci I get the following error:

Cannot find module ‘jest-resolve/build/default_resolver’

I’ve tried changing the restore cache keys, but to no avail.

I get the following message when building:

No cache is found for key: v3-dependencies-HEf30cW5ZJDiyBnTGKlOtPsWFyZE40Mmy846ExfsO14=
No cache is found for key: v3-dependencies-

But when it is done, I get the following message in the Saving Cache stage:

Skipping cache generation, cache already exists for key: v1-dependencies-HEf30cW5ZJDiyBnTGKlOtPsWFyZE40Mmy846ExfsO14=
Found one created at 2019-02-18 21:29:02 +0000 UTC

This is the build: https://circleci.com/gh/YonatanKra/palram/62

Any idea why this happens?

It reads like the cache keys are not the same in the getter and the setter.

Do you mind pasting your Circle CI configuration file here? (or the relevant bits at least)

Thanks. That solves the caching issue :slight_smile:
That was the problem:

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

I now see the cache is saved correctly.

I still have a problem with jest - while everything works locally, in circleci the build doesn’t pass because of a missing npm module (which exists locally).

It’s part of jest’s dependencies - and since jest is installed, I cannot tell why its dependencies are not being installed as well.
Is there a way for me to see the resulting node_modules?

Ok - figured it out. It was a package.json/package.lock.json conflict. Solved :slight_smile:

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