Skip to content

TypeError: LRU is not a constructor #2619

@jasmasher

Description

@jasmasher

I believe there is a conflict version with the lru-cache package. After some digging noticed that lru-cache v8.0.0 is the only version that exports the class as "default" and that's how is refernced in the code

const LRU = require('lru-cache').default;

but if for some reason there is a version conflict on that library, which in my case happened you get that error. I also noticed that mysql2 has this dependeny "named-placeholders": "^1.1.3" but "named-placeholders dependecy is "lru-cache": "^7.14.1".

I'm nort sure why npm is not crying about this but in my case I'm getting lru-cache "5.1.1" which is even worst.

I fixed the issue by manually installing lru-cache v8.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions