setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

Include Node.js version in cache key

Open clintonb opened this issue 1 year ago • 2 comments

Description: The Node.js version should be included in the cache key. The major version number, (e.g., 22 in 22.12) should be used to avoid unnecessary invalidation when upgrading to patch or minor versions.

This is similar to https://github.com/actions/setup-node/issues/1008.

Justification: Some dependencies need to be rebuilt for specific Node versions. Reusing the cache for an older version results in dependency installation failures.

Are you willing to submit a PR? Yes.

clintonb avatar Dec 14 '24 07:12 clintonb

Hello @clintonb , Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.


gowridurgad avatar Dec 16 '24 05:12 gowridurgad

Any new on this issue ? In monorepo with packages to test with different Node.js, applications not all with the same Node.js version, the actual generated key lead to dependencies which need to be rebuilt each time.

tpoisseau avatar May 13 '25 14:05 tpoisseau

Any new update on the issue?

ayeshasaeed665 avatar Nov 03 '25 07:11 ayeshasaeed665