Open jprosevear opened 9 months ago
I second this issue. From what I have found in this stackoverflow question it seems that npm ci
doesn't really benefit from cache and that is by its design. npm install
is the command that takes advantage of cache but according to npm's documentation npm ci
is the command that should be used in CI/CD environments.
Last month we stopped storing cache in CircleCI and we saw huge savings on our monthly bill in both reduced build minutes and storage costs.
I think caching should be disabled by default when using npm ci
and that should be made clear in CircleCI's documentation that npm ci
does not take advantage of cache. As the documentation for this orb stands, it gives the appearance that it will automatically handle caching for you and that will save you credits when in reality people using npm as their package manager end up paying more money with caching turned on.
Any update on this? This feels at best like a bug that should be fixed soon and at worst CircleCI intentionally deceiving its clients to make more money.
Thanks for the heads up, the new version https://circleci.com/developer/orbs/orb/circleci/node?version=6.1.0 is now ignoring cache when npm ci
is used.
When you say
the new version [...] is now ignoring cache when
npm ci
is used
does that mean that the orb is no longer trying to create a cache when using npm ci
? We know that npm ci
ignores any existing cache, but the issue here (beyond the documentation, which I see is now better) was that it was also creating a cache, which used up storage.
I'm just making sure I'm understanding you right.
Yes, when npm ci
is used it will ignore the caching functionality. No cache will be created, therefore no storage used.
Awesome, thanks @marboledacci!
Orb version:
5.1.0
What happened:
Caching is turned on by default but not used by default because npm ci is used for installation
Expected behavior:
npm ci uses the cache that is restored
Additional Information: