https://github.com/TryGhost/node-sqlite3#custom-builds-and-electron
Running sqlite3 through electron-rebuild does not preserve the SQLCipher extension, so some additional flags are needed to make this build Electron compatible. Your npm install sqlite3 –build-from-source command needs these additional flags
これによると
--target=x.x.x
の部分はelectronのバージョン番号。
こんな感じでインストールした方がいいらしい?
electronアプリを配布する時electron builderやelectron forgeでパッケージングするけど、そのままだとパッケージング後にsqlite3 moduleが見つからないって言われた。
この時はPackage.jsonのdevDependencies
にsqlite3があるのをdependencies
の方に移す必要がある。
他プラットフォーム用のビルドを用意するにはちょっと癖があるらしい。ちゃんと調べてないけどどうせmac用のビルドにはmacが必要だしwindowsやlinuxデバイスはどっかに転がってるしそれぞれのプラットフォームでそれぞれのビルドを用意してやれば早いと思う。