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?
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.
I am also following the prescribed instructions from CircleCI on yarn cached deps, but seeing dependencies never get cached.
--frozen-lockfile should yield a failure if the lockfile requires any change or even if it needs to get created. Additionally, if the cache lockfile were changing everytime, a new cache would be created for the key, but I’m seeing that Circle is identifying a cache at the location!