New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using better-sqlite3 in a VS Code extension #385
Comments
I think this is unrelated to better-sqlite3. VS Code is based on Electron, which comes with its own version of Node. And since you cannot control which version of Electron / VS Code a given user has installed it's a hard problem to solve and it is not supported by VS Code, see microsoft/vscode#658 https://github.com/microsoft/vscode/search?q=NODE_MODULE_VERSION&type=Issues |
This is probably related to #271 |
you can try to use electron-rebuild -f -w better-sqlite3 to resolve this problem |
Closing due to inactivity |
Dormant but still very pertinent - I have the same issue and it appears our real problem is related to #545. Anyone wanting to use better-sqlite3 in a VS Code extension would have the same issue. Guessing I have to look through @vscode/test-electron for something similar to a |
Okay, after a total of 3 hours of troubleshooting, the solution goes like this - if you're seeing an error like
Then we need to update our local version of electron (as provided by the To update, run UPDATE |
I am wondering if anyone has experience using better-sqlite3 in a vs code extension? I created an extension using Yeoman as described in the docs.
I would like to take an existing node app that I have that uses better-sqlite3 (it works great in the standalone node app) and incorporate parts of it into the extension. When I install better-sqlite3 into the extension project and run I get this error:
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 or npm install).
I understand that vs code extensions use a special version of node. What I am unsure of is what I need to do in the extension project in order to use better-sqlite3? Code extensions are supposed to be able to be installed on different platforms, will this be possible?
The text was updated successfully, but these errors were encountered: