jaredwray / cacheable

Caching for Nodej.js
https://cacheable.org
MIT License
1.56k stars 163 forks source link

Version 5.7.2 requires node >= 20 #727

Closed pandemonia closed 3 months ago

pandemonia commented 3 months ago

Describe the bug lru-cache has been updated to 11.0.0 with version 5.7.2, but this version drops support for node 18. Looks to me that the lru-cache version change should be a major version upgrade on cache-manager as well.

How To Reproduce (best to provide workable code or tests!) Attempting to add the package in a node-18 environment fails:

❯ yarn add cache-manager                                                                                                                                             18:11:40
yarn add v1.22.19
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error lru-cache@11.0.0: The engine "node" is incompatible with this module. Expected version "20 || >=22". Got "18.20.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

❯ node --version                                                                                                                                                     18:11:44
v18.20.3
jaredwray commented 3 months ago

@pandemonia - did you have issues with running it as our tests said it was ok.

pandemonia commented 3 months ago

@jaredwray I hadn't checked that, and to clarify my concern here isn't with the package functionality. The change in minimum node version to 20 (from to lru-cache@11.0.0) means that this version of cache-manager cannot be added in package using a node 18 runtime.

ie, these two are incompatible:

Screenshot 2024-07-12

To get this version working in my application running on node 18 I will need to pass --ignore-engines to yarn, which is not a workaround that should be required here.

victororozco commented 3 months ago

This is because lru-cache has changed the minimum version of the nodes to >= 20

https://github.com/isaacs/node-lru-cache/commit/7965d883291e90581174d39600a7706f9cce5f95

Version 5.7.X should continue with the lru-cahe in ^10.2.2

jaredwray commented 3 months ago

@pandemonia @victororozco - this has now been resolved as we reverted back. Please use cache-manager@5.7.3