WiseLibs / better-sqlite3

The fastest and simplest library for SQLite3 in Node.js.
MIT License
5.58k stars 394 forks source link

better_sqlite3.node is not a valid Win32 application #934

Closed raphael10-collab closed 1 year ago

raphael10-collab commented 1 year ago

I'm developing an Electron-React-Typescript-Webpack app in Ubuntu 22.04 Desktop environment, and I'm trying to understand how to make the ongoing app fully operable in Windows environment

I executed the make command for win32 :

raphy@raohy:~/ForgeTypescriptReactWebpack$ yarn make --platform=win32
yarn run v1.22.19
$ electron-forge make --platform=win32
✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
  › Making for the following targets: squirrel, zip
✔ Running package command
  ✔ Preparing to package application
  ✔ Running packaging hooks
    ✔ Running generateAssets hook
    ✔ Running prePackage hook
      ✔ [plugin-webpack] Preparing native dependencies: 1 / 1
      ✔ [plugin-webpack] Building webpack bundles
  ✔ Packaging application
    ✔ Packaging for x64 on win32 [6s]
  ✔ Running postPackage hook
✔ Running preMake hook
✔ Making distributables
  ✔ Making a squirrel distributable for win32/x64 [45s]
  ✔ Making a zip distributable for win32/x64 [8s]
✔ Running postMake hook
  › Artifacts available at: /home/raphy/ForgeTypescriptReactWebpack/out/make

Made executable the file : sudo chmod +x forgetypescriptreactwebpack-1.0.0.exe

 raphy@raohy:~/ForgeTypescriptReactWebpack/out/make/squirrel.windows/x64$ ls -lah
total 168M
drwxrwxr-x 2 raphy raphy 4,0K gen  6 11:30 .
drwxrwxr-x 3 raphy raphy 4,0K gen  6 11:27 ..
-rwxr-xr-x 1 raphy raphy  85M gen  6 11:27 forgetypescriptreactwebpack-1.0.0.exe
-rw-rw-r-- 1 raphy raphy  84M gen  6 11:27 forgetypescriptreactwebpack-1.0.0-full.nupkg
-rw-rw-r-- 1 raphy raphy   97 gen  6 11:27 RELEASES

and tried to execute it in Windows 11 . This time I get new error related to better-sqlite3 which I use in my toy app :

image

I've found these other github's issues : https://github.com/WiseLibs/better-sqlite3/issues/723 https://github.com/WiseLibs/better-sqlite3/issues/515

But I do not understand what practically do I have to do, once I packaged the app with electron-forge

raphael10-collab commented 1 year ago

I solved the issue producing the executable for windows within Windows environment