Yarn: Yarn caches should be invalidated when switching versions

Created on 25 Nov 2016  路  5Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
feature

What is the current behavior?

We sometimes introduce changes to cache logic which make cache from previous version incompatible with the next one.

What is the expected behavior?

Yarn should ignore caches generated by another version.

Most helpful comment

Perhaps we should version the cache, and clear it if the version doesn't match (similar to how lockfiles are versioned). So, the current cache would have a version of 1, then we'd bump it to 2 if any breaking changes are made.

All 5 comments

This has been the solution for most issues posted. yarn cache clean.

Perhaps we should version the cache, and clear it if the version doesn't match (similar to how lockfiles are versioned). So, the current cache would have a version of 1, then we'd bump it to 2 if any breaking changes are made.

It would require some discipline but I agree with you, @Daniel15

Bootcamped the issue

Done!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

whitecolor picture whitecolor  路  96Comments

donaldpipowitch picture donaldpipowitch  路  75Comments

carlosduclos picture carlosduclos  路  86Comments

MichelDiz picture MichelDiz  路  80Comments

jmorrell picture jmorrell  路  93Comments