• Any idea how come keyt is recognized correctly with the relevant functions (getPassword in this case) but still will fail when calling that function?
    I mean generally, what can cause such error, any tip or hint might help me to go forward.

  • @amoss I don’t get the demo. Keytar is not used anywhere and there’s no electron project in quasar defined.

    Each release of keytar includes prebuilt binaries for the versions of Node and Electron that are actively supported by these projects. Please refer to the release documentation for Node and Electron to see what is supported currently.

    It will only work in electron and in nodejs.

  • Well, when running as web, it fails with: Keytar,getPassword is not a function.
    When running as electron (executable), it fails with:
    Error: node-loader: Error: C:\Users\user\AppData\Local\Temp\07e92995-d4c3-47dc-8b61-d882691c2e86.tmp.node is not a valid Win32 application. C:\Users\user\AppData\Local\Temp\07e92995-d4c3-47dc-8b61-d882691c2e86.tmp.node

    I’m kinda lost 🙂 The application itself is running ok, only that line specifically fails.
    I don’t understand why it fails with “is not a valid Win32 application” - in github, the person told me that I must be doing something wrong and closed the ticket.
    I guess I’m the only one ever to try to use Keytar or to add a “remember me” feature to his login window.
    If not, I wonder how other people managed to do it.

    The demo is from the very first/initial try to use Keytar before I tested deeper, not that it made me any progress 🙂

  • @amoss It will not run on the web ever.

    As for the error:

    • try linux
    • try other 32 bit/64bit nodejs versions. Use nvm

    Or give me a real demo where you actually get the error for electron.

  • There you go:
    Thanks a lot!

  • @amoss

    the " is not a valid Win32 application" error means you have to rebuild the keytar module for your system ( it’s a native module)

    I followed this guide:

    Solution 2


  • Thanks, a newbie question in order for me not to damage anything, in solution 2 point b I saw

    from an unprivileged shell

    mkdir electron-keytar
    cd electron-keytar
    npm init
    npm install electron
    npm install keytar
    npm install electron-rebuild --save-dev
    .\node_modules.bin\electron-rebuild -w keytar -p -f

    Because I already have a project folder with the relevant installations (electron, keytar and electron rebuild), is it enough for me just to run
    .\node_modules.bin\electron-rebuild -w keytar -p -f

  • @amoss
    Yes that’s enough , if you have the right visual c++ libaries installed ect ( probably not). BUt just try it. You probably get missing visual c++ libs or something.

    What I had to do was:

    npm install --global --production windows-build-tools
    npm install --global node-gyp
    ( I did not have to do this because I already had python)
    setx PYTHON $\python27\python.exe

    Than it still gave me errors, so I had to manually update the visual c++ 2020 libs or something 😉

    if you get this too I let me know…

  • It looks a bit cumbersome (to my non-professional eyes) to achieve what I need.
    I appreciate a lot your effort and wanting to help but I will first finish some unfinished business I have in the queue and then I’ll get to this.
    Again, thanks a lot!

  • @amoss sure no problem I learned a lot too!

Log in to reply