Comments (18)
./node_modules/.bin/electron-rebuild
^ This worked for me
from node-keytar.
We had the same problem but got around it by ensuring that ./node_modules/.bin/electron-rebuild is run directly after any npm install on our macs
from node-keytar.
same problem with node-usb
App threw an error during load
Error: The module 'node_modules/usb/src/binding/usb_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
I installed the rebuild tool using npm install electron-rebuild
and ran ./node_modules/.bin/electron-rebuild
. Seemed to work. Wish I knew what the root cause was, though.
from node-keytar.
@Acika00mk also remember to rebuild dev dependencies as electron-rebuild
only does prod and optional dependencies by default.
Use this instead for devDependencies
as well
./node_modules/.bin/electron-rebuild -p -t "dev,prod,optional"
-p
for parallel
from node-keytar.
Having the same issue with node 8.2.1 and electron 1.7.8 (think this is an electron / electron-rebuild problem. Electron uses a different version of NodeJs than your environment.)
have a look at: https://github.com/electron/electron-rebuild
electron and node-hid; using electron-rebuild, but getting:
(For me rebuild only works as script named "postinstall", not tested yet)
Uncaught Exception:
Error: The module '/Users/samvieten/dev/mwad3/app/node_modules/xbox-controller/node_modules/node-hid/build/Release/HID.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/samvieten/dev/mwad3/app/node_modules/xbox-controller/node_modules/node-hid/index.js:5:15)
at Object.<anonymous> (/Users/samvieten/dev/mwad3/app/node_modules/xbox-controller/node_modules/node-hid/index.js:94:3)
from node-keytar.
HI,
had the same issue,
and i fixed it with
"electron": "^1.8.2",
"keytar-prebuild": "^4.1.1",
"electron-rebuild": "^1.7.3",
node version : 8.9.4
Include in the main.ts/main.js file
const keytar = require('keytar-prebuild');
Remove node_modules folder and package-lock.json.
Do normal npm install
then ./node_modules/.bin/electron-rebuild
.
If you want you can try to package it to an app, it will work. Tested.
from node-keytar.
Passing the target version number using the -v
arg worked for me.
Note: this is the Electron version, not the Node version.
Eg ./node_modules/.bin/electron-rebuild -v 1.7.12
from node-keytar.
I faced the same issue with grpc module and in my case, I was using electron and have set a wrong electron version in the env variable "export npm_config_target=1.2.3", setting it to the electron version I am using resolved the issue on my end. Hope this helps someone who set env variables as given here (https://electronjs.org/docs/tutorial/using-native-node-modules#the-npm-way)
from node-keytar.
Also can reproduce with electron-forge:
electron-forge init test-project
cd test-project
npm install keytar --save
add the following to index.html:
<script>
import {remote} from 'electron'
const keytar = remote.require('keytar')
</script>
npm start
On load I get the following error in the console:
Uncaught Error: The module '/Volumes/Code/test-project/node_modules/keytar/build/Release/keytar.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
Error: The module '/Volumes/Code/test-project/node_modules/keytar/build/Release/keytar.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Volumes/Code/test-project/node_modules/keytar/lib/keytar.js:1:169)
at Object.<anonymous> (/Volumes/Code/test-project/node_modules/keytar/lib/keytar.js:55:3)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Volumes/Code/test-project/node_modules/keytar/lib/keytar.js:1:169)
at Object.<anonymous> (/Volumes/Code/test-project/node_modules/keytar/lib/keytar.js:55:3)
at metaToValue (/Volumes/Code/test-project/node_modules/electron-prebuilt-compile/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/renderer/api/remote.js:234:13)
at Object.exports.require (/Volumes/Code/test-project/node_modules/electron-prebuilt-compile/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/renderer/api/remote.js:313:10)
at file:///Volumes/Code/test-project/src/index.html:14:33
Still using macOS and node 8.4.0
from node-keytar.
I'm also having this problem on both node 6.11.4 and 8.6.0 (tried both)
from node-keytar.
This sounds like more of an electron
problem than a node-keytar
problem
from node-keytar.
I can't find 54 version at https://nodejs.org/en/download/releases/, any suggestions ?
from node-keytar.
It's the module version, think it's used in Node v. 7.0.0 (just a guess)
from node-keytar.
I'm having the same problem as OP (the exact version by the way)
I am using nvm to downgrade my env node version to the exact current Electron node version, also, I am using electron-rebuild in order to try rebuild the imported module.
The native module is mine and compiled by my own.
I've tried to follow this tutorial but the error keeps going on, and I dunno how to do.
from node-keytar.
I am having the same issue with nwjs, could not find a working solution
from node-keytar.
@bwheeler96 's solution worked for me to
- Install electron-rebuild: npm install --save-dev electron-rebuild
- Run $(npm bin)/electron-rebuild to build binaries for the right version of node
- Add "$(npm bin)/electron-rebuild" in my package.json scripts
Followed the instructions on https://github.com/electron/electron-rebuild "How does it work?"
from node-keytar.
I had this same issue with a different library. I came accross this issue, and @benjcresswell 's solution worked for me, but I was on Windows - so I ran:
.\node_modules\.bin\electron-rebuild.cmd
Thanks to everyone's efforts to resolve this.
from node-keytar.
Closing this out because building native modules correctly is outside the scope of keytar
, and the Electron docs are what I recommend reading to get your environment setup.
from node-keytar.
Related Issues (20)
- Prebuild problem on Windows HOT 1
- Not being able to install on Windows. v8.h missing
- electron-rebuild fails after updating keytar to 7.7.0
- WSL Support
- Upgrade dependencies' major versions HOT 7
- https://www.instagram.com/p/CaAP2_VsEFp/?utm_medium=copy_linkc
- [win] handle different value for cred.Persist = CRED_PERSIST_ENTERPRISE;
- [Windows] Old credential comes back after current one is deleted HOT 3
- Keytar installation fails on Alpine Linux (Docker image) HOT 1
- Switch to prebuildify & node-gyp-build HOT 2
- Proposal: Support buffers for binary keychain data
- Not attempting prebuilt install
- setPassword error
- Add a new setPasswordDescription method
- Opt out from having the service name implicitly be concatenated with the account name on windows.
- Setting a password throws strange Error: �ڴ���Դ���㣬�����������” HOT 2
- `FindCredentials` call on Linux without unlocking the key store crashes
- Fails to install on Windows ARM
- Node
- Farewell, my dear Keytar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-keytar.