electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.58k stars 1.73k forks source link

error in rebuilding native dependency on win10 #8426

Closed kerwinxu closed 3 days ago

kerwinxu commented 3 weeks ago

kindly the below error

rebuilding native dependencies  dependencies=@serialport/bindings-cpp@12.0.1 platform=win32 arch=x64
  • rebuilding native dependency  name=@serialport/bindings-cpp version=12.0.1
  ⨯ cannot execute  cause=fork/exec C:\Users\kerwin\.yarn\releases\yarn-1.22.19.cjs: %1 is not a valid Win32 application.
                    command='C:\Users\kerwin\.yarn\releases\yarn-1.22.19.cjs' run install
                    workingDir=C:\Users\kerwin\Desktop\com_helper\node_modules\@serialport\bindings-cpp
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

but i can Manually build.

node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@20.16.0 | win32 | x64
gyp info find Python using Python version 3.11.5 found at "C:\Users\kerwin\AppData\Local\Programs\Python\Python311\python.exe"

gyp info find VS using VS2022 (17.5.33424.131) found at:
gyp info find VS "d:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Users\kerwin\AppData\Local\Programs\Python\Python311\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\kerwin\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\kerwin\\Desktop\\com_helper\\node_modules\\@serialport\\bindings-cpp\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\kerwin\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\kerwin\\AppData\\Local\\node-gyp\\Cache\\20.16.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\kerwin\\AppData\\Local\\node-gyp\\Cache\\20.16.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\kerwin\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\kerwin\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.16.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\kerwin\\Desktop\\com_helper\\node_modules\\@serialport\\bindings-cpp',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Users\\kerwin\\Desktop\\com_helper\\node_modules\\@serialport\\bindings-cpp\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
C:\Users\kerwin\Desktop\com_helper\node_modules\@serialport\bindings-cpp>node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@20.16.0 | win32 | x64
gyp info find Python using Python version 3.11.5 found at "C:\Users\kerwin\AppData\Local\Programs\Python\Python311\python.exe"

gyp info find VS using VS2022 (17.5.33424.131) found at:
gyp info find VS "d:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Users\kerwin\AppData\Local\Programs\Python\Python311\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\kerwin\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\kerwin\\Desktop\\com_helper\\node_modules\\@serialport\\bindings-cpp\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\kerwin\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\kerwin\\AppData\\Local\\node-gyp\\Cache\\20.16.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\kerwin\\AppData\\Local\\node-gyp\\Cache\\20.16.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\kerwin\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\kerwin\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.16.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\kerwin\\Desktop\\com_helper\\node_modules\\@serialport\\bindings-cpp',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Users\\kerwin\\Desktop\\com_helper\\node_modules\\@serialport\\bindings-cpp\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn d:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build\\binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“-m”开关。

  serialport.cpp
  serialport_win.cpp
  win_delay_load_hook.cc
    正在创建库 C:\Users\kerwin\Desktop\com_helper\node_modules\@serialport\bindings-cpp\build\Release\bindings.lib 和对 象 C:\Us
  ers\kerwin\Desktop\com_helper\node_modules\@serialport\bindings-cpp\build\Release\bindings.exp
  bindings.vcxproj -> C:\Users\kerwin\Desktop\com_helper\node_modules\@serialport\bindings-cpp\build\Release\\bindings.
  node
gyp info ok
mmaietta commented 2 weeks ago

@kerwinxu this looks like 24.13.13 logs for electron-builder I think. If so, can you try next tag v25.0.5? We upgraded to use upstream/official electron/rebuild package for handling native modules.

TheCrypt0 commented 1 week ago

We faced the same issue and your suggestion actually worked, @mmaietta thanks!

Unfortunately, using the v25.0.5 fixes the build on Windows but now is broken on Mac. 😢

Here is the output on Mac OS Sonoma 14.6.1 :

dist-electron/preload/index.mjs  1.91 kB │ gzip: 0.88 kB
✓ built in 8ms
  • electron-builder  version=25.0.5 os=23.6.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=out/builder-effective-config.yaml
  ⨯ open /FULL_PATH_REDACTED/node_modules/create-hash/md5.js/package.json: not a directory
github.com/develar/app-builder/pkg/node-modules.(*Collector).resolveDependency
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:236
github.com/develar/app-builder/pkg/node-modules.(*Collector).processDependencies
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:122
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:64
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:80
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:80
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:80
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:80
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:80
github.com/develar/app-builder/pkg/node-modules.ConfigureCommand.func1
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/tree.go:41
github.com/alecthomas/kingpin.(*actionMixin).applyActions
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28
github.com/alecthomas/kingpin.(*Application).applyActions
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557
github.com/alecthomas/kingpin.(*Application).execute
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390
github.com/alecthomas/kingpin.(*Application).Parse
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222
main.main
        /Users/runner/work/app-builder/app-builder/main.go:90
runtime.main
        /Users/runner/hostedtoolcache/go/1.21.12/arm64/src/runtime/proc.go:267
runtime.goexit
        /Users/runner/hostedtoolcache/go/1.21.12/arm64/src/runtime/asm_arm64.s:1197  
  ⨯ /FULL_PATH_REDACTED/node_modules/app-builder-bin/mac/app-builder_arm64 process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1  failedTask=build stackTrace=Error: /FULL_PATH_REDACTED/node_modules/app-builder-bin/mac/app-builder_arm64 process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/FULL_PATH_REDACTED/node_modules/builder-util/src/util.ts:255:14)
    at Object.onceWrapper (node:events:635:26)
    at ChildProcess.emit (node:events:520:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems like an issue related to app-builder

For whatever reason, it tries to find a folder in /node_modules/create-hash/md5.js/package.json but it fails: image

Version 24.13.3 works fine on Mac.

mmaietta commented 1 week ago

@beyondkmp can you please take a look at this when you have a chance? Looks related to the app-builder-bin changes

beyondkmp commented 1 week ago

The createHash library depends on the md5.js library, and there might be issues with such paths on macOS. I'll try to reproduce and check.

https://github.com/browserify/createHash/blob/master/package.json#L35

Crease29 commented 1 week ago

I'm having the same issue on Ubuntu WSL2.

$ electron-builder install-app-deps
  • electron-builder  version=25.0.5
  ⨯ open /home/user/code/project/node_modules/create-hash/md5.js/package.json: not a directory
github.com/develar/app-builder/pkg/node-modules.(*Collector).resolveDependency
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:236
github.com/develar/app-builder/pkg/node-modules.(*Collector).processDependencies
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:122
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:64
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:80
github.com/develar/app-builder/pkg/node-modules.(*Collector).readDependencyTree
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/nodeModuleCollector.go:80
github.com/develar/app-builder/pkg/node-modules.ConfigureCommand.func1
        /Users/runner/work/app-builder/app-builder/pkg/node-modules/tree.go:41
github.com/alecthomas/kingpin.(*actionMixin).applyActions
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28
github.com/alecthomas/kingpin.(*Application).applyActions
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557
github.com/alecthomas/kingpin.(*Application).execute
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390
github.com/alecthomas/kingpin.(*Application).Parse
        /Users/runner/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222
main.main
        /Users/runner/work/app-builder/app-builder/main.go:90
runtime.main
        /Users/runner/hostedtoolcache/go/1.21.12/arm64/src/runtime/proc.go:267
runtime.goexit
        /Users/runner/hostedtoolcache/go/1.21.12/arm64/src/runtime/asm_amd64.s:1650
  ⨯ /home/user/code/project/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1  failedTask=installAppDeps stackTrace=Error: /home/user/code/project/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/user/code/project/node_modules/builder-util/src/util.ts:255:14)
    at Object.onceWrapper (node:events:629:26)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
node -v
v20.10.0
yarn -v
1.22.22
beyondkmp commented 6 days ago
nativeRebuilder = sequential “legacy” | “sequential” | “parallel” | “undefined” - Use legacy app-builder binary for installing native dependencies, or @electron/rebuild in sequential or parallel compilation modes.

@Crease29 Which configuration are you using for the nativeRebuilder?

Crease29 commented 6 days ago
nativeRebuilder = sequential “legacy” | “sequential” | “parallel” | “undefined” - Use legacy app-builder binary for installing native dependencies, or @electron/rebuild in sequential or parallel compilation modes.

@Crease29 Which configuration are you using for the nativeRebuilder?

I'm not overwriting this config flag, so I assume the default is sequential. Shall I try with an other value?

Crease29 commented 6 days ago

electron-builder install-app-deps is part of my postinstall script and that's where it's failing. I think at that point it hasn't even read any config flags yet.

The same command runs perfectly fine with 25.0.0-alpha.7

$ electron-builder install-app-deps
  • electron-builder  version=25.0.0-alpha.7
  • executing @electron/rebuild  electronVersion=29.4.6 arch=x64 buildFromSource=false appDir=./
  • installing native dependencies  arch=x64
  • completed installing native dependencies
Done in 12.26s.
mmaietta commented 6 days ago

Hmmm, there's not much I can find in the diff (https://github.com/electron-userland/electron-builder/compare/v25.0.0-alpha.7...v25.0.5#diff-7f97d68f3da2a576ab7689e166a9b012ab54ec606fc9833057830240df76c532 other than packages/app-builder-lib/src/util/yarn.ts) Can you try this patch-package? app-builder-lib+25.0.5.patch

diff --git a/node_modules/app-builder-lib/out/util/yarn.js b/node_modules/app-builder-lib/out/util/yarn.js
index 0ec91e6..7456ebc 100644
--- a/node_modules/app-builder-lib/out/util/yarn.js
+++ b/node_modules/app-builder-lib/out/util/yarn.js
@@ -169,9 +169,11 @@ async function rebuild(config, appDir, options) {
         debug: builder_util_1.log.isDebugEnabled,
         projectRootPath: await (0, search_module_1.getProjectRootPath)(appDir),
         mode: config.nativeRebuilder || "sequential",
-        buildFromSource: buildFromSource,
         disablePreGypCopy: true,
     };
+    if (buildFromSource) {
+        rebuildOptions.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild";
+    }
     return (0, rebuild_1.rebuild)(rebuildOptions);
 }
 //# sourceMappingURL=yarn.js.map
\ No newline at end of file
Crease29 commented 6 days ago

I've installed electron-builder 25.0.5, applied the changes to that file node_modules/app-builder-lib/out/util/yarn.js and ran yarn electron-builder install-app-deps, but still the same error message.

$ yarn electron-builder install-app-deps
yarn run v1.22.22
$ /home/user/code/project/node_modules/.bin/electron-builder install-app-deps
  • electron-builder  version=25.0.5
  ⨯ open  /home/user/code/project/node_modules/create-hash/md5.js/package.json: not a directory
github.com/develar/app-builder/pkg/node-modules.(*Collector).resolveDependency
[...]
Crease29 commented 6 days ago

Just for testing I've added a console log at that spot but it's not even executed. Here's the stack trace again:

Exit code:
1  failedTask=installAppDeps stackTrace=Error: /home/user/code/project/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/user/code/project/node_modules/builder-util/src/util.ts:255:14)
    at Object.onceWrapper (node:events:629:26)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
Crease29 commented 6 days ago

Found the issue! When I remove crypto-browserify (v3.12.0) it works. When I install it again, it fails.

TheCrypt0 commented 5 days ago

I can confirm that manually removing the crypto-browserify folder from node_modules, although not ideal, seems to take the process a step ahead but now it breaks here for me:

yarn run v1.22.22
$ vite build -m prod && electron-builder --mac --win -p always
vite v5.3.2 building for prod...
✓ 316 modules transformed.
dist/index.html                            0.60 kB │ gzip:   0.38 kB
dist/assets/full-logo-CYuPax31.svg         6.57 kB │ gzip:   2.69 kB
dist/assets/HKNova-Regular-DKYRK5-9.ttf   91.38 kB
dist/assets/HKNova-Medium-DlIpTjze.ttf    91.98 kB
dist/assets/index-Fed0Psmw.css            29.86 kB │ gzip:   5.18 kB
dist/assets/rom-Caghk6Eh.js                0.05 kB │ gzip:   0.07 kB
dist/assets/esp32h2-Cf8JbGZQ.js            6.82 kB │ gzip:   4.43 kB
dist/assets/esp32c2-CtjOOsCE.js            6.83 kB │ gzip:   4.36 kB
dist/assets/esp32c6-BRG5ZpJ8.js            6.86 kB │ gzip:   4.44 kB
dist/assets/esp32c3-DDsZSfEd.js            6.94 kB │ gzip:   4.49 kB
dist/assets/esp32-BPYaDt9v.js              7.65 kB │ gzip:   4.62 kB
dist/assets/esp32s2-BOsRKhcm.js            7.83 kB │ gzip:   4.92 kB
dist/assets/esp32s3-DkgZlzv1.js            8.76 kB │ gzip:   5.47 kB
dist/assets/esp32p4-DfBdIAkh.js            9.89 kB │ gzip:   5.34 kB
dist/assets/esp8266-8VKmCx7J.js           14.14 kB │ gzip:   8.65 kB
dist/assets/index-DZO29Qgt.js            532.60 kB │ gzip: 170.81 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 1.04s
vite v5.3.2 building for prod...
✓ 2 modules transformed.
dist-electron/main/index.js  4.63 kB │ gzip: 1.85 kB
✓ built in 10ms
vite v5.3.2 building for prod...
✓ 1 modules transformed.
dist-electron/preload/index.mjs  1.91 kB │ gzip: 0.88 kB
✓ built in 6ms
  • electron-builder  version=25.0.5 os=23.6.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=out/builder-effective-config.yaml
  • executing @electron/rebuild  electronVersion=29.3.3 arch=arm64 buildFromSource=false appDir=./
  • installing native dependencies  arch=arm64
  • preparing       moduleName=@serialport/bindings-cpp arch=arm64
  ⨯ (node:45544) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Traceback (most recent call last):
  File "/Users/user/project/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File "/Users/user/project/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
    import gyp.input
  File "/Users/user/project/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
Error: `gyp` failed with exit code: 1
    at ChildProcess.onCpExit (/Users/user/project/node_modules/node-gyp/lib/configure.js:325:16)
    at ChildProcess.emit (node:events:520:28)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)

  ⨯ node-gyp failed to rebuild '/Users/user/project/node_modules/@serialport/bindings-cpp'  failedTask=build stackTrace=Error: node-gyp failed to rebuild '/Users/user/project/node_modules/@serialport/bindings-cpp'
    at ChildProcess.<anonymous> (/Users/user/project/node_modules/@electron/rebuild/lib/module-type/node-gyp/node-gyp.js:118:24)
    at ChildProcess.emit (node:events:520:28)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems like it is trying to rebuild the serialport package, but shouldn't it use the already built binaries? (https://serialport.io/docs/guide-platform-support#supported-platforms-and-architectures)

With electron-builder v24.13.3 it was working fine.

beyondkmp commented 5 days ago

Found the issue! When I remove crypto-browserify (v3.12.0) it works. When I install it again, it fails.

I will try it .

mmaietta commented 5 days ago

Looks like it needs to run preparing moduleName=@serialport/bindings-cpp arch=arm64 as there is no provided binary for arm64 (only a universal per https://serialport.io/docs/guide-platform-support#supported-platforms-and-architectures We build a universal x64/M1 binary)

Does this issue happen when building an x64 version of your app?

TheCrypt0 commented 5 days ago

@mmaietta thanks for the suggestion, I just tried and here's the result.

Running

electron-builder --mac --arm64 -p always

or

electron-builder --mac --x64 -p always

or

electron-builder --mac --x64 --arm64 -p always

Outputs the same error.

Let me know if I can help with the troubleshooting in any other way.