I have built a node app that uses a module to work with a database (better-sqlite3).
It works fine as a node app. but, Now I am trying to make a VS Code extension that has most of the same functionality.
However, when I install the module, build, and run the new extension I get this message:
Activating extension 'undefined_publisher.myPlugin' failed: The module '\?\C:...\node_modules\better-sqlite3\build\Release\better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 75. Please try re-compiling or re-installing the module (for instance, using
npm rebuild
ornpm install
)..
I understand that VS Code extensions are Electron apps and they use a different version of the node then the one I created for my pure node app but I am unclear what I have to do in the extension to build the module (better-sqlite3) with the correct version of node?
node-gyp
uses the correct Node version that the Electron framework uses. This might answer your question: #46385091 – Embellish