isaacs / node-lru-cache

A fast cache that automatically deletes the least recently used items
http://isaacs.github.io/node-lru-cache/
ISC License
5.38k stars 353 forks source link

SyntaxError: Unexpected token '(' => #initializeTTLTracking() #296

Closed dancarasco closed 1 year ago

dancarasco commented 1 year ago

I recently updated my project which uses vue-docgen-api which has a dependency of lru-cache. Upon execution I receive the following error from Node (v12.19.0)

node_modules/vue-docgen-api/node_modules/lru-cache/dist/cjs/index.js:359
    #initializeTTLTracking() {
                          ^

SyntaxError: Unexpected token '('
    at wrapSafe (internal/modules/cjs/loader.js:931:16)
    at Module._compile (internal/modules/cjs/loader.js:979:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:903:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (node_modules/vue-docgen-api/node_modules/lru-cache/dist/cjs/index-cjs.js:5:36)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

My use case is that I am trying to build a java-doc type file for my Vue project, which uses vue-docgen-api to generate the output. vue-docgen-api relies on lru-cache.

Screenshot from 2023-05-03 17-11-04

Please advise, thanks!

isaacs commented 1 year ago

Node 14 or higher is required.

https://github.com/isaacs/node-lru-cache/blob/main/package.json#L80-L82