Electron ---- Better-Sqlite3 使用问题
错误信息
1 | The module '/node_modules/better-sqlite3/build/better_sqlite3.node' |
解决方法
npm install --save-dev electron-rebuild
使用electron-rebuild进行重新编译:
node_modules/.bin/electron-rebuild -f -w better-sqlite3
如果没有编译成功, 则查看是否安装了, node-gyp
因为在 electron-rebuild 项目的 README 里,
看到这句话:
1 | If you have a good node-gyp config but you see an error about a missing element on Windows like `Could not load the Visual C++ component "VCBuild.exe"`, try to launch electron-rebuild in an npm script: |