l1veIn / lol-wom-electron

LOL互动助手electron-part
78 stars 4 forks source link

关于在macOS上构建与运行问题 #2

Closed LanYunDev closed 2 hours ago

LanYunDev commented 2 hours ago

将依赖robotjs换成@jitsi/robotjs,能解决macOS arm上的安装依赖问题 将编译好应用打开报错:

Uncaught Exception:
Error: Could not load the "sharp" module using the darwin-arm64 runtime
ERR_DLOPEN_FAILED: dlopen(/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/.com.lolwom.app.5iMXYA, 0x0001): Library not loaded: @rpath/libvips-cpp.42.dylib
Referenced from: <8791EE4B-BC08-3720-9DD2-BC610F2FA3E6> /private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/.com.lolwom.app.5iMXYA
Reason: tried: '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../../sharp-libvips-darwin-arm64/1.0.4/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../../node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../../../../@img-sharp-libvips-darwin-arm64-npm-1.0.4-d0d063884a/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../../sharp-libvips-darwin-arm64/1.0.4/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../../node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/9y/mkk3rkyd065g3x6jwd3pl1hc0000gn/T/../../../../../@img-sharp-libvips-darwin-arm64-npm-1.0.4-d0d063884a/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.42.dylib' (no such file), '/Users/lanyun/Documents/Github项目/lol-wom-electron/dist/mac-arm64/lol_wom_helper.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libvips-cpp.42.dylib' (no such file), '/Users/lanyun/Documents/Github项目/lol-wom-electron/dist/mac-arm64/lol_wom_helper.app/Contents/Frameworks/libvips-cpp.42.dylib' (no such file)
Possible solutions:
- Ensure optional dependencies can be installed:
npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
npm install --os=darwin --cpu=arm64 sharp
- Consult the installation documentation:
See https://sharp.pixelplumbing.com/install
at Object.<anonymous> (/Users/lanyun/Documents/Github项目/lol-wom-electron/dist/mac-arm64/lol_wom_helper.app/Contents/Resources/app.asar/node_modules/sharp/lib/sharp.js:113:9)
at Module._compile (node:internal/modules/cjs/loader:1373:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1432:10)
at Module.load (node:internal/modules/cjs/loader:1215:32)
at Module._load (node:internal/modules/cjs/loader:1031:12)
at c._load (node:electron/js2c/node_init:2:17025)
at Module.require (node:internal/modules/cjs/loader:1240:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/Users/lanyun/Documents/Github项目/lol-wom-electron/dist/mac-arm64/lol_wom_helper.app/Contents/Resources/app.asar/node_modules/sharp/lib/constructor.js:10:1)
at Module._compile (node:internal/modules/cjs/loader:1373:14)

试图通过 "asarUnpack": ["/node_modules/sharp//*"] 来解决这个问题,但失效. 通过对mac平台关闭asar能解决这个问题,但遇到下面问题: Uncaught Exception: Error: ENOENT: no such file or directory, open 'game-shell-data.db'

image
LanYunDev commented 2 hours ago

另外布局也存在一点小问题

image

https://github.com/l1veIn/lol-wom-electron/pull/3

LanYunDev commented 2 hours ago

看了下应用根路径下也有这个文件,但不知道为啥没检测到

image
LanYunDev commented 2 hours ago

刚刚修复了文件找不到的问题 https://github.com/l1veIn/lol-wom-electron/pull/3 关于布局问题,作者大大有空可以搞搞~

l1veIn commented 15 minutes ago

好的,后续会专门把html部分重写一份本地构建版出来,目前的html是像小程序一样挂服务器了,方便更新

LanYunDev commented 13 minutes ago

感谢大佬~🎉