node-abletonlink icon indicating copy to clipboard operation
node-abletonlink copied to clipboard

Error when used with Electron

Open jellohouse opened this issue 3 years ago • 10 comments

Hey,

I tried importing the abletonlink module in my Electron App. But I'm getting this error: TypeError: exists is not a function

It seems to be caused by the "bindings" node module dependency.

Any ideas on how to fix or approach this?

jellohouse avatar Aug 25 '22 16:08 jellohouse

Also just tried importing the library in the main electron process (instead of the renderer), But this gives me an error that the architecture is incompatible: "has x86_64 needs arm64e"

jellohouse avatar Aug 25 '22 19:08 jellohouse

However I also just tested this example app https://github.com/2bbb/node-abletonlink-example and it works properly...

If anyone has any suggestions please let me know :)

jellohouse avatar Aug 30 '22 15:08 jellohouse

@jellohouse what's version of electron what you use? maybe this package build for arm64 architecture. isn't architecture of electron x86_64?

2bbb avatar Aug 30 '22 16:08 2bbb

please test file node_modules/electron/dist/Electron.app/Contents/MacOS/Electron with terminal on project directory

2bbb avatar Aug 30 '22 16:08 2bbb

Hi @2bbb !

I'm using "electron": "^19.0.8"

Testing the file node_modules/electron/dist/Electron.app/Contents/MacOS/Electron in terminal I got

node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: Mach-O 64-bit executable arm64

Seems like it is arm64. I think because I have mac m1 which is arm based cpu...

I guess that is the problem.. but still not sure how I could solve it. Any ideas?

jellohouse avatar Aug 30 '22 17:08 jellohouse

ok. and try file node_modules/abletonlink/build/Rel ease/abletonlink.node too.

2bbb avatar Aug 30 '22 17:08 2bbb

Ok so file node_modules/abletonlink/build/Release/abletonlink.node gives me:

node_modules/abletonlink/build/Release/abletonlink.node: Mach-O 64-bit bundle x86_64

So yes this module is compiled for x86_64 architecture.

I'm not too familiar with node-gyp and stuff, but I think there must be away you can compile builds for both arm64 and x86_64 architecture. This would be very helpful for people with m1 macs.

Do you think it is possible? If so any chance you could make a new release that can have this?

jellohouse avatar Aug 30 '22 17:08 jellohouse

I think you might just have to update your node-gyp to latest and it would do it automatically: https://github.com/nodejs/node-gyp/issues/1764

jellohouse avatar Aug 30 '22 17:08 jellohouse

Also see this https://github.com/nodejs/node-gyp/issues/2391#issuecomment-1081750694

jellohouse avatar Aug 30 '22 18:08 jellohouse

Hey @2bbb any updates or thoughts on this?

jellohouse avatar Sep 01 '22 16:09 jellohouse

on my env, file node_modules/abletonlink/build/Release/abletonlink.node returns Mach-O 64-bit bundle arm64 I don't know why your envs got x86_64 binary.

2bbb avatar Jun 15 '23 18:06 2bbb

I published 0.2.0-beta.0 with update versions of dependencies. please test with npm i [email protected]!

2bbb avatar Jun 15 '23 21:06 2bbb

maybe this problem was solved. if there is some problems, then please Reopen.

2bbb avatar Jul 12 '23 07:07 2bbb