请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

正在回答 回答被采纳积分+3

1回答

张轩 2021-06-05 10:34:14

同学你好 升级到最新版的 electron 和 electron builder 即可,详情可以看:https://segmentfault.com/a/1190000038594967 这里

0 回复 有任何疑惑可以回复我~
  • 提问者 Xiaobai3 #1
    这个我有搜索试过可以打包成功,但是打出来的arm64包在M1芯片电脑上打开会有异常:
    Uncaught Exception:
    Error: dlopen(/Applications/美图云修beta.app/Contents/Resources/app/node_modules/ref-napi/build/Release/binding.node, 1): no suitable image found.  Did find:
    /Applications/美图云修beta.app/Contents/Resources/app/node_modules/ref-napi/build/Release/binding.node: mach-o, but wrong architecture
    /Applications/美图云修beta.app/Contents/Resources/app/node_modules/ref-napi/build/Release/binding.node: mach-o, but wrong architecture
    at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1812)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1203:18)
    at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1812)
    at Module.load (internal/modules/cjs/loader.js:992:32)
    at Module._load (internal/modules/cjs/loader.js:885:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12633)
    at Module.require (internal/modules/cjs/loader.js:1032:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at load (/Applications/mtyx.app/Contents/Resources/app/node_modules/node-gyp-build/index.js:21:10)
    at Object.<anonymous> (/Applications/mtyx.app/Contents/Resources/app/node_modules/ref-napi/lib/ref.js:8:53)
    回复 有任何疑惑可以回复我~ 2021-06-10 09:41:01
  • 提问者 Xiaobai3 #2
    还有种直接打一个universal包适配两种机器。但是这个直接会打包异常,没看出是什么原因,不知道有没遇到过:
    
    lipo /private/var/folders/n8/qqq3qcm95rg9c9hfh9j5w1p00000gn/T/electron-universal-ktu89n/Tmp.app/Contents/Resources/app/node_modules/ffi-napi/prebuilds/darwin-x64/electron.napi.node /Users/caojh/Documents/workspace/electron-luff/dist_electron/apk-pro/1.5.0/MT/mac-universal--arm64/mtyx.app/Contents/Resources/app/node_modules/ffi-napi/prebuilds/darwin-x64/electron.napi.node -create -output /private/var/folders/n8/qqq3qcm95rg9c9hfh9j5w1p00000gn/T/electron-universal-ktu89n/Tmp.app/Contents/Resources/app/node_modules/ffi-napi/prebuilds/darwin-x64/electron.napi.node
    
    fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /private/var/folders/n8/qqq3qcm95rg9c9hfh9j5w1p00000gn/T/electron-universal-ktu89n/Tmp.app/Contents/Resources/app/node_modules/ffi-napi/prebuilds/darwin-x64/electron.napi.node and /Users/caojh/Documents/workspace/electron-luff/dist_electron/apk-pro/1.5.0/MT/mac-universal--arm64/mtyx.app/Contents/Resources/app/node_modules/ffi-napi/prebuilds/darwin-x64/electron.napi.node have the same architectures (x86_64) and can't be in the same fat output file
    回复 有任何疑惑可以回复我~ 2021-06-10 09:53:11

相似问题

登录后可查看更多问答,登录/注册

问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信