-
Notifications
You must be signed in to change notification settings - Fork 194
Unable to compile for electron target: caused by recent node-addon-api 3.1.0 => 3.2.0 update #386
Comments
Not sure I understand the issue, as we're using Lines 2206 to 2210 in 1248408
And our Line 53 in 1248408
There's some extra context here about how we're prebuild-ing for N-API now #331 so I'm not sure if that's somehow affected things |
I was also able to do this successfully with the latest version on macOS (using our version of
|
Lock file doesn't make sense if the module is installed from npm (since lock files don't get published to npm), so the new node-addon-api version got into the game by "node-addon-api": "^3.0.0" range. I just don't use prebuilds and this is how the issue got noticed.
I've tried both 8.0.0 (globally installed) and ./node_modules/.bin/node-gyp (7.1.2), the result is the same. Try it with node-addon-api@3.2.0.
Maybe the issue is OS-specific. I don't have macOS system to test it in my own. |
I'm having the same problem; I think it only fails with newer versions of node. With node 14.11.0 installed, I can build successfully; with later versions, it fails.
@shiftkey - if you install the latest version of node and then try to build, can you see the issue? |
I'm on Node v14.17.1 and I have the same problem @PalmerAL |
I just pinned keytar/node-addon-api@3.1.0 as a workaround for use with node 15. |
Btw, node-addon-api v4 was released about 2 weeks ago and it's also affected. |
I was having this issue on Windows with node 14.17.1 - I found the error does not occur with keytar version 7.6.0 so it seems to be something in the 7.7.0 release. |
@Wiltuk I have the same problem with keytar 7.6.0 on my side. Event after deleting node_modules and lock file. |
+1 have this exact issue on macOS. Can fix by running on node 14 <= 14.16.1, but our team needs 15+ for ARM builds of our electron application. Any insight on this would be highly appreciated EDIT: It seems that what @PalmerAL said is spot on. Using Node 15 <15.12.0 works fine, so it must be something with NAPIv8 is causing this. |
No workaround with the lastest LTS version of node? |
@Brouilles see the issue title, ie downgrading node-addon-api to 3.1.0 is a workaround. |
Any update on this? Some of our other dependencies (lodash in particular) don't support node 15, only node 14/16. But we need 15+ for ARM builds so 16 would be our only option, but because of node-addon-api issues it doesn't work on node 16... |
@vladimiry , I am also facing the same issue. I updated the keytar version from 7.3.0 to 7.7.0. I also installed node-addon-api version 3.1.0. But still I am facing the same issue. May I know what was your work around? |
The workaround was in downgrading node-addon-api to 3.1.0 but I removed downgrade in my project some time ago as the issue got fixed somewhere upstream (currently used node-addon-api is 3.2.1). So I believe the issue can be closed now. |
May I know your current Electron and Node version? |
Thanks for your response. But I am getting the error you mentioned at the top even after downgrading node-addon-api to 3.1.0. It works fine only when I use the node version 14.11.0. |
I guess node-gyp version also might be a part of the stack, at my side it's node-gyp@8.2.0. |
Steps to Reproduce
HOME=~/.electron-gyp node-gyp rebuild --target=13.0.0-beta.27 --arch=x64 --dist-url=https://electronjs.org/headers
Gives:
Works fine if I downgrade node-addon-api 3.2.0 => 3.1.0.
The text was updated successfully, but these errors were encountered: