Skip to content
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

Keytar module doesn't build successfully #1636

Open
sdsumit opened this issue Jun 5, 2021 · 5 comments
Open

Keytar module doesn't build successfully #1636

sdsumit opened this issue Jun 5, 2021 · 5 comments
Labels

Comments

@sdsumit
Copy link

sdsumit commented Jun 5, 2021

while running npm run buildDebian, I am facing the below issue.

System:
20.04.1-Ubuntu
npm -v : 7.16.0
node -v : v16.1.0
uname -i : x86_64

Logs:
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/tmp/electron-packager/linux-x64/min-linux-x64/resources/app/node_modules/keytar/build'
CXX(target) Release/obj.target/keytar/src/async.o
In file included from ../../node-addon-api/napi.h:2725,
from ../src/async.cc:4:
../../node-addon-api/napi-inl.h: In member function ‘bool Napi::Object::Freeze()’:
../../node-addon-api/napi-inl.h:1393:24: error: ‘napi_object_freeze’ was not declared in this scope; did you mean ‘napi_object_expected’?
1393 | napi_status status = napi_object_freeze(_env, _value);
| ^~~~~~~~~~~~~~~~~~
| napi_object_expected
../../node-addon-api/napi-inl.h: In member function ‘bool Napi::Object::Seal()’:
../../node-addon-api/napi-inl.h:1399:24: error: ‘napi_object_seal’ was not declared in this scope; did you mean ‘napi_object’?
1399 | napi_status status = napi_object_seal(_env, _value);
| ^~~~~~~~~~~~~~~~
| napi_object
make: *** [keytar.target.mk:125: Release/obj.target/keytar/src/async.o] Error 1
make: Leaving directory '/tmp/electron-packager/linux-x64/min-linux-x64/resources/app/node_modules/keytar/build'
/home/sdxt/min/node_modules/electron-rebuild/lib/src/module-rebuilder.js:193
throw new Error(errorMessage);
^

Error: node-gyp failed to rebuild '/tmp/electron-packager/linux-x64/min-linux-x64/resources/app/node_modules/keytar'.
Error: make failed with exit code: 2

at ModuleRebuilder.rebuildNodeGypModule (/home/sdxt/min/node_modules/electron-rebuild/lib/src/module-rebuilder.js:193:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Rebuilder.rebuildModuleAt (/home/sdxt/min/node_modules/electron-rebuild/lib/src/rebuild.js:190:9)
at async Rebuilder.rebuild (/home/sdxt/min/node_modules/electron-rebuild/lib/src/rebuild.js:152:17)
@PalmerAL
Copy link
Collaborator

PalmerAL commented Jun 6, 2021

Same issue as this: atom/node-keytar#386

@PalmerAL PalmerAL changed the title Facing issue while using buildDebian Keytar module doesn't build successfully Jun 6, 2021
@PalmerAL
Copy link
Collaborator

For now, it looks like you need to downgrade to an older version of node for this to work - try installing 14.x. (There's more information in the issue I mentioned above).

@lubiedo lubiedo added the bug label Jun 28, 2021
@iambudi
Copy link

iambudi commented Jul 25, 2021

Same issue as this: atom/node-keytar#386

I had this issue as well on macOS BigSur. Node v16.5.0, npm 7.20.1.
Solved using 3.1.0 npm install --save node-addon-api@3.1.0

@Ranjith-Eswaran-G
Copy link

@PalmerAL , The electron-rebuild operation fails after upgrading keytar from 7.3.0 to 7.7.0. I found that it works fine only in node v14.11.0 . My current electron version is 11.5.0. I am dependent on node version 11.17.4 for some other features. So can you please let me know if you found any other workaround for using keytar 7.7.0?

@PalmerAL
Copy link
Collaborator

You could use NVM to just use node 14 for this project: https://github.com/nvm-sh/nvm

I recently removed the usage of this module: #1809. It needs to stay in the build for a couple releases so that we can migrate passwords that were stored using it, but in a few months we should be able to remove it entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants