I have cloned my mobile project built on Windows onto a Mac and I'm running into issues trying to pack the electron app.
I believe the first issue is with using the correct node version, possibly related to homebrew. I need to use node 18, but when I attempt to pack the electron app the console shows node 23.5.0. I've updated the path for node, but Wappler continues to find 23.5 somewhere.
Checking NodeJS installation and version...
v23.5.0
NodeJS is correctly installed.
Checking Capacitor installation and version...
6.2.0
⠙Capacitor is correctly installed.
System check successful!
If you are experiencing some build errors please make sure to check the Platform Guide for electron:
https://capacitor-community.github.io/electron/
The build was previsouly complaining about missing the following, even though these existed in the project.json under the Electron directory. I added them to the root package.json and that got past the error, but I'm not sure that is this is ideal.
electron
electron-unhandled
electron-updater
electron-serve
electron-window-state
I'm still getting errors when attempting to bulid.
Sync your project for electron ...
[warn] The bundledWebRuntime configuration option has been deprecated. Please, use a bundler to bundle Capacitor and its
plugins.
- Copying Web App to Electron platform
- Copying Web App to Electron platform: start 🚀
ℹ Copying Web App to Electron platform: start 🚀
- Copying Web App to Electron platform: Copying /Users/keithfawcett/Documents/brightyard-desktop-app-v4/www into /Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/app
ℹ Copying Web App to Electron platform: Copying /Users/keithfawcett/Documents/brightyard-desktop-app-v4/www into /Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/app
✔ Copying Web App to Electron platform: completed in 148.10ms
- Updating Electron plugins
- Updating Electron plugins: start 🚀
ℹ Updating Electron plugins: start 🚀
- Updating Electron plugins: searching for plugins
Unable to find node_modules/@tiptap/core.
Are you sure @tiptap/core is installed?
Unable to find node_modules/@tiptap/extension-placeholder.
Are you sure @tiptap/extension-placeholder is installed?
Unable to find node_modules/@tiptap/pm.
Are you sure @tiptap/pm is installed?
Unable to find node_modules/@tiptap/starter-kit.
Are you sure @tiptap/starter-kit is installed?
Unable to find node_modules/electron-serve.
Are you sure electron-serve is installed?
Unable to find node_modules/electron-unhandled.
Are you sure electron-unhandled is installed?
ℹ Updating Electron plugins: searching for plugins
- Updating Electron plugins: generating electron-plugins.js
ℹ Updating Electron plugins: generating electron-plugins.js
- Updating Electron plugins: installing electron plugin files
Will install: @capacitor-community/sqlite@5.7.4
✖ Updating Electron plugins:
node:internal/process/promises:392
new UnhandledPromiseRejection(reason);
^
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "npm warn deprecated @types/chokidar@2.1.3: This is a stub types definition. chokidar provides its own type definitions, so you do not need this installed.
npm warn deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm warn deprecated electron-rebuild@3.2.9: Please use @electron/rebuild moving forward. There is no API change, just a package name change
npm error code 1
npm error path /Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/better-sqlite3-multiple-ciphers
npm error command failed
npm error command sh -c prebuild-install || node-gyp rebuild --release
npm error TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm error CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm error LIBTOOL-STATIC Release/sqlite3.a
npm error CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm error rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error prebuild-install warn install No prebuilt binaries found (target=23.5.0 runtime=node arch=arm64 libc= platform=darwin)
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@9.4.1
npm error gyp info using node@23.5.0 | darwin | arm64
npm error (node:22510) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm error gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/better-sqlite3-multiple-ciphers/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/Users/keithfawcett/Library/Caches/node-gyp/23.5.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/Users/keithfawcett/Library/Caches/node-gyp/23.5.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/better-sqlite3-multiple-ciphers',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error In file included from ../src/better_sqlite3.cpp:4:
npm error In file included from ./src/better_sqlite3.lzz:11:
npm error In file included from /Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/node.h:73:
npm error In file included from /Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/v8.h:23:
npm error In file included from /Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/cppgc/common.h:8:
npm error /Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/v8config.h:13:2: error: "C++20 or later required."
npm error 13 | #error "C++20 or later required."
npm error | ^
npm error In file included from ../src/better_sqlite3.cpp:4:
npm error ./src/util/macros.lzz:31:69: error: no template named 'CopyablePersistentTraits' in namespace 'v8'; did you mean 'NonCopyablePersistentTraits'?
npm error 31 | template <class T> using CopyablePersistent = v8::Persistent<T, v8::CopyablePersistentTraits<T>>;
npm error | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
npm error | NonCopyablePersistentTraits
npm error /Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/v8-persistent-handle.h:223:7: note: 'NonCopyablePersistentTraits' declared here
npm error 223 | class NonCopyablePersistentTraits {
npm error | ^
npm error In file included from ../src/better_sqlite3.cpp:4:
npm error ./src/util/macros.lzz:149:6: error: no type named 'AccessorGetterCallback' in namespace 'v8'; did you mean 'AccessorNameGetterCallback'?
npm error 149 | v8::AccessorGetterCallback func
npm error | ~~~~^~~~~~~~~~~~~~~~~~~~~~
npm error | AccessorNameGetterCallback
npm error /Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/v8-object.h:155:7: note: 'AccessorNameGetterCallback' declared here
npm error 155 | using AccessorNameGetterCallback =
npm error | ^
npm error ./src/util/macros.lzz:158:6: error: no type named 'AccessorGetterCallback' in namespace 'v8'; did you mean 'AccessorNameGetterCallback'?
npm error 158 | v8::AccessorGetterCallback func
npm error | ~~~~^~~~~~~~~~~~~~~~~~~~~~
npm error | AccessorNameGetterCallback
npm error /Users/keithfawcett/Library/Caches/node-gyp/23.5.0/include/node/v8-object.h:155:7: note: 'AccessorNameGetterCallback' declared here
npm error 155 | using AccessorNameGetterCallback =
npm error | ^
npm error ./src/util/macros.lzz:172:28: error: no member named 'SetAccessor' in 'v8::ObjectTemplate'
npm error 172 | recv->InstanceTemplate()->SetAccessor(
npm error | ~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm error ./src/objects/database.lzz:19:17: error: no matching function for call to 'SetPrototypeGetter'
npm error 19 | SetPrototypeGetter(isolate, data, t, "open", JS_open);
npm error | ^~~~~~~~~~~~~~~~~~
npm error ./src/util/macros.lzz:153:6: note: candidate function not viable: no known conversion from 'void (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &)' to 'v8::AccessorNameGetterCallback' (aka 'void (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 5th argument
npm error 153 | void SetPrototypeGetter(
npm error | ^
npm error 154 | v8::Isolate* isolate,
npm error 155 | v8::Local<v8::External> data,
npm error 156 | v8::Local<v8::FunctionTemplate> recv,
npm error 157 | const char* name,
npm error 158 | v8::AccessorGetterCallback func
npm error | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ./src/objects/database.lzz:20:17: error: no matching function for call to 'SetPrototypeGetter'
npm error 20 | SetPrototypeGetter(isolate, data, t, "inTransaction", JS_inTransaction);
npm error | ^~~~~~~~~~~~~~~~~~
npm error ./src/util/macros.lzz:153:6: note: candidate function not viable: no known conversion from 'void (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &)' to 'v8::AccessorNameGetterCallback' (aka 'void (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 5th argument
npm error 153 | void SetPrototypeGetter(
npm error | ^
npm error 154 | v8::Isolate* isolate,
npm error 155 | v8::Local<v8::External> data,
npm error 156 | v8::Local<v8::FunctionTemplate> recv,
npm error 157 | const char* name,
npm error 158 | v8::AccessorGetterCallback func
npm error | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ./src/objects/database.lzz:182:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
npm error 182 | int status = sqlite3_db_config(db_handle, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL);
npm error | ^
npm error ./src/objects/statement.lzz:16:17: error: no matching function for call to 'SetPrototypeGetter'
npm error 16 | SetPrototypeGetter(isolate, data, t, "busy", JS_busy);
npm error | ^~~~~~~~~~~~~~~~~~
npm error ./src/util/macros.lzz:153:6: note: candidate function not viable: no known conversion from 'void (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &)' to 'v8::AccessorNameGetterCallback' (aka 'void (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 5th argument
npm error 153 | void SetPrototypeGetter(
npm error | ^
npm error 154 | v8::Isolate* isolate,
npm error 155 | v8::Local<v8::External> data,
npm error 156 | v8::Local<v8::FunctionTemplate> recv,
npm error 157 | const char* name,
npm error 158 | v8::AccessorGetterCallback func
npm error | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ./src/util/custom-table.lzz:45:9: warning: missing field 'xIntegrity' initializer [-Wmissing-field-initializers]
npm error 45 | };
npm error | ^
npm error ./src/util/custom-table.lzz:72:9: warning: missing field 'xIntegrity' initializer [-Wmissing-field-initializers]
npm error 72 | };
npm error | ^
npm error 3 warnings and 8 errors generated.
npm error make: *** [Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.onExit (/Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/node-gyp/lib/build.js:203:23)
npm error gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Darwin 24.2.0
npm error gyp ERR! command "/opt/homebrew/Cellar/node/23.5.0/bin/node" "/Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/.bin/node-gyp" "rebuild" "--release"
npm error gyp ERR! cwd /Users/keithfawcett/Documents/brightyard-desktop-app-v4/electron/node_modules/better-sqlite3-multiple-ciphers
npm error gyp ERR! node -v v23.5.0
npm error gyp ERR! node-gyp -v v9.4.1
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /Users/keithfawcett/.npm/_logs/2024-12-30T17_44_36_254Z-debug-0.log
".
at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)
at processPromiseRejections (node:internal/process/promises:475:17)
at process.processTicksAndRejections (node:internal/process/task_queues:106:32) {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v23.5.0
Packing your project for electron ...
electron sync successfully!
> Brightyard@1.1.0 electron:make
> npm run prebuild && npm run build && electron-builder build -c ./electron-builder.config.json -p always
> Brightyard@1.1.0 prebuild
> node set-artifact-name.js
Electron artifact name set to: ${productName}-Setup.${ext}
> Brightyard@1.1.0 prebuild
> node set-artifact-name.js
Electron artifact name set to: ${productName}-Setup.${ext}
> Brightyard@1.1.0 build
> tsc && electron-rebuild
sh: electron-rebuild: command not found
Error packing your project for electron!