Skip to content

NODE_MODULE_VERSION mismatch when running better-sqlite3 on Node 21.7.3 #1437

@philipaxelsson94

Description

@philipaxelsson94

I am trying to run my project using better-sqlite3 on Node 21.7.3 (macOS), but I get a NODE_MODULE_VERSION mismatch error. The module was compiled against a different Node.js version, and I cannot get it to work even after rebuilding from source. I would really appreciate any help.

Attempts to fix

  • Removed all node_modules and package-lock.json
  • Cleared npm cache and ~/.node-gyp
  • Ran npm install --build-from-source
  • Verified node -v shows 21.7.3

Error: The module 'node_modules/better-sqlite3/build/Release/better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 127. This version of Node.js requires NODE_MODULE_VERSION 120. Please try re-compiling or re-installing. Node.js v21.7.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions