silexlabs / Silex

Silex live web creation, free/libre no-code website builder, next gen Webflow for the static web
http://www.silex.me
GNU Affero General Public License v3.0
2.22k stars 580 forks source link

How to build silex desktop from the source code on windows #1428

Closed sniperwolfpk5 closed 1 year ago

sniperwolfpk5 commented 1 year ago

I am trying to build a silex-desktop from the source code. I am facing a lot of issues. Please give details what are the steps to build silex desktop.

For your information I have successfully build a silex web version along with my custom storage plugin without any issues. I am unable to build silex-desktop version

The following is the required dependency list.

I tried different commands to build but without any success.

Set local configurations in package.json

 "config": {
    "node_gyp":"$_\node_modules\node-gyp\bin\node-gyp.js",
    "msvs_version": 2019,
    "python":"C:\\Python311"
  },

Commands I tries

npm i --msvs_version=2019
npm install --global windows-build-tools --msvs_version=2022 --msvs_path="C:\Program Files\Microsoft Visual Studio\2022\Enterprise"

I tries with VS 2019 but without any success

npm i --install-strategy=shallow

I have tried many different combinations but without any success.

Errors that I faced

npm ERR! code 7
npm ERR! path D:\WITLine\Projects\Silex\silex-desktop-2.7.33\node_modules\iconv
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@19.3.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.1 found at "C:\Python311\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.33130.400) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack     at createConfigFile (D:\WITLine\Projects\Silex\silex-desktop-2.7.33\node_modules\node-gyp\lib\configure.js:117:21)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "D:\\nodejs\\node.exe" "D:\\WITLine\\Projects\\Silex\\silex-desktop-2.7.33\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\WITLine\Projects\Silex\silex-desktop-2.7.33\node_modules\iconv
npm ERR! gyp ERR! node -v v19.3.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! code 1
npm ERR! path D:\WITLine\Projects\Silex\silex-desktop-2.7.33\node_modules\lzma-native
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build && rimraf build
npm ERR! node:internal/modules/cjs/loader:1042
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module 'D:\WITLine\Projects\Silex\silex-desktop-2.7.33\node_modules\node-pre-gyp\bin\node-pre-gyp'
npm ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:885:27)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
npm ERR!     at node:internal/main/run_main_module:23:47 {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: []

There were other errors that I faced. I fixed some of them. I want official build steps. I will give you more details upon request