-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module napi-v6-darwin-unknown-x64 in the universal app #7473
Comments
Sure thing. Can you create a minimum reproducible repo for this, such as using For context on the change, the |
Here is But I got now an error during > electron-quick-start@1.0.0 dist-mac
> electron-builder --config ./electron-builder.json --mac --universal
• electron-builder version=24.0.0 os=22.3.0
• loaded configuration file=/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/electron-builder.json
• writing effective config file=compile/builder-effective-config.yaml
• executing @electron/rebuild appDir=/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start arch=x64
• loaded configuration file=/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/electron-builder.json
Attempting to build a module with a space in the path
See https://github.com/nodejs/node-gyp/issues/65#issuecomment-368820565 for reasons why this may not work
CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
LIBTOOL-STATIC Release/nothing.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3410100/sqlite3.c
/bin/sh: projects/electron-quick-startt/electron-quick-start/node_modules/sqlite3/build/Release/lib.host:/Users/omaralfroukh/Desktop/Test: No such file or directory
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3410100/sqlite3.o
LIBTOOL-STATIC Release/sqlite3.a
CXX(target) Release/obj.target/node_sqlite3/src/backup.o
clang: error: no such file or directory: 'projects/electron-quick-startt/electron-quick-start/node_modules/sqlite3/node_modules/node-addon-api'
make: *** [Release/obj.target/node_sqlite3/src/backup.o] Error 1
⨯ node-gyp failed to rebuild '/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/sqlite3'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
Error: `make` failed with exit code: 2
failedTask=build stackTrace=Error: node-gyp failed to rebuild '/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/sqlite3'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
Error: `make` failed with exit code: 2
at NodeGyp.rebuildModule (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/@electron/rebuild/src/module-type/node-gyp.ts:133:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at ModuleRebuilder.rebuildNodeGypModule (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/@electron/rebuild/src/module-rebuilder.ts:93:5)
at ModuleRebuilder.rebuild (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/@electron/rebuild/src/module-rebuilder.ts:129:8)
at Rebuilder.rebuildModuleAt (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/@electron/rebuild/src/rebuild.ts:203:9)
at Rebuilder.rebuild (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/@electron/rebuild/src/rebuild.ts:158:9)
at installOrRebuild (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/util/yarn.ts:29:5)
at Packager.installAppDependencies (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/packager.ts:525:7)
at MacPackager.doPack (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/platformPackager.ts:219:5)
at MacPackager.doPack (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/macPackager.ts:111:9)
at MacPackager.pack (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/macPackager.ts:194:7)
at Packager.doBuild (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/packager.ts:442:9)
at executeFinally (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/builder-util/src/promise.ts:12:14)
at Packager._build (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/packager.ts:376:31)
at Packager.build (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/app-builder-lib/src/packager.ts:337:12)
at executeFinally (/Users/omaralfroukh/Desktop/Test projects/electron-quick-startt/electron-quick-start/node_modules/builder-util/src/promise.ts:12:14) Steps to reproduce:
Thanks for your response! |
I guess I can prob take a look at the repro repo later today or this weekend. |
@oalfroukh sorry for the off-topic comment but I'm wondering what |
Got it working with the sample project you sent me @oalfroukh
electron-builder.js config excerpt
|
I think the extensions ".mk", ".a", ".o", and ".h" are used for make files, static libraries, object files, and header files, respectively. Each of these file types serves a specific purpose in the process of compiling and linking source code, but as I saw no need to be in the generated app (at least in my project), |
Hi @mmaietta |
Hi @mmaietta ,
Thanks again! |
I used the exact project config your electron-quick-start used with I also dont own an intel mac to test with |
Yes, removing ** Any suggestion to move forward in solving the issue because those folders should exist in the expected result in the Thanks for your follow-up! |
Wait, why is it not leveraging
|
An unexpected error occurred at startup
09/03/2023, 17:06:04 EET Error details:
name: Error,
message: Cannot find module '/Applications/myApp.app/Contents/Resources/app-x64.asar/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-x64/node_sqlite3.node'
Require stack:
- /Applications/myApp.app/Contents/Resources/app-x64.asar/node_modules/sqlite3/lib/sqlite3-binding.js
- /Applications/myApp.app/Contents/Resources/app-x64.asar/node_modules/sqlite3/lib/sqlite3.js
- /Applications/myApp.app/Contents/Resources/app-x64.asar/dist/main-bundle.js
- /Applications/myApp.app/Contents/Resources/app.asar/index.js
- ,
|
Hi again @mmaietta Another point maybe will help in the investigation, if you try to use electron v |
I trust you there. Was finally able to emulate an x64 mac and create the crash you've been describing, did so by invoking rosetta to launch the app.
The other route is to right click -> "Get Info" -> "Launch using Rosetta" I just built a x64-only app using your electron-quick-start.zip you previously linked, and it fails to launch with the same error.
The reason it's failing is because |
Here you go, this fixes it for me
I was able to launch the app successfully with Rosetta 2 env. |
Hi @mmaietta, I have another question maybe it's not related to this topic I see there is a warning message "Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+" Does this mean the generated dmg will never work on OSX 10.11 and below? if yes, does generating Universal dmg from Intel machine will support these OSX versions, and will be the same efficient as that generated app from arm64? |
That's correct. |
OK, thanks a lot Mike! |
Updated |
electron-builder --config ./electron-builder.json --mac --universal
), but I got this error in the run time for the app after building it from the M1 machine with XCode v14.2 (I'm usingsqlite3 v5.1.4
)myApp.app/Contents/Resources directory
in theApplication
pathAs you see there is no
napi-v6-darwin-unknown-x64
insideapp-x64.asar.unpacked
while there isnapi-v{napi_build_version}-darwin-unknown-x64
When I tried to build the app from an Intel machine (Xcode
v14.2
) there isnapi-v6-darwin-unknown-x64
insideapp-x64.asar.unpacked
while there is nonapi-v6-darwin-unknown-arm64
insideapp-arm64.asar.unpacked
(napi-v{napi_build_version}-darwin-unknown-arm64
exists)Here is
electron-builder.json
contents:** Update: The issue doesn't exist when using
electron-builder v23.6.0
, it seems related to the latest version (24.0.0
)The text was updated successfully, but these errors were encountered: