How to use sqlite3 module with electron?

前端 未结 10 1372
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 01:43

I want to develop desktop app using electron that uses sqlite3 package installed via npm with the command

npm install --save sqlite3

but it

10条回答
  •  抹茶落季
    2020-11-28 02:23

    I was having same problem. Tried everything and atlast this worked for me :-

    npm install --save sqlite3
    npm install --save electron-rebuild
    npm install --save electron-prebuilt
    .\node_modules\.bin\electron-rebuild.cmd
    

    This will create "electron-v1.3-win32-x64" folder in .\node_modules\sqlite3\lib\binding\ location which is used by electron to use sqlite3.

    Just start application and you will be able to use sqlite3 now.

提交回复
热议问题