Giter Club home page Giter Club logo

Comments (7)

pokusew avatar pokusew commented on July 28, 2024

Hi @madsbrydegaard,

Node.js 10.x (the one Electron uses now) and 11.x were not supported due to outdated bindings to Node Native modules API.

I upgraded all the dependencies (especially @pokusew/pcsclite) and also made a lot of fixes. Support for all recent Node.js versions along with many improvements is available in v0.7.0. πŸš€

Please upgrade nfc-pcsc in your dependencies and let me know if it works for you. πŸ™‚

Hope it helps. πŸ™‚


PS Don't forget to star ⭐️my library, if you find it useful. πŸ˜ƒThanks.

from nfc-pcsc.

madsbrydegaard avatar madsbrydegaard commented on July 28, 2024

Hi @pokusew
Thanks for the quick reply and new update.
However it doesnt seem to fix the problem. I am still getting the same error...

I updated the dependency, nuked the modules cache, npm rebuild, electron rebuild and then npm start...

packages.json:

{
  "name": "electron.card-loader",
  "version": "0.0.1",
  "description": "Electron.CardLoader",
  "main": "nfc-pcsc.js",
  "scripts": {
    "start": "electron ."
  },
  "author": {
    "name": ""
  },
  "dependencies": {},
  "devDependencies": {
    "electron": "^4.0.0",
    "electron-rebuild": "^1.8.2",
    "nfc-pcsc": "0.7.0"
  }
}

But unfortunately still the same error as above...
I am however new to electron so maybe I am missing something?

Any help is greatly appreciated.
Thnx

from nfc-pcsc.

pokusew avatar pokusew commented on July 28, 2024

Hi @madsbrydegaard,

Please try the following:

  1. Ensure the the NFC reader is connected to the computer, before starting the app
  2. Start the app
  3. If it works – then it is the known Windows issue, which in some cases prevents the nfc-pcsc to work correctly when the reader is not connected.
  4. It it does not work – I think something in your setup is not configured correctly. Please create a repo on GitHub, push your code and send me a link here and I'll look into it.

Hope it helps. πŸ™‚

from nfc-pcsc.

madsbrydegaard avatar madsbrydegaard commented on July 28, 2024

Hi @pokusew
I have now tested again and it still fails using electron.

Link to repo: https://github.com/madsbrydegaard/electron-pcsc

However using node runtime instead of electron it works very well.
Any help is greatly appreciated ;)

Thnx

from nfc-pcsc.

pokusew avatar pokusew commented on July 28, 2024

Hi @madsbrydegaard,

I cloned the repo and successfully started the app.

I think, that your problem is incorrect electron-rebuild usage.

The correct flow is:

  1. install the dependencies
  2. rebuild native modules you want to run inside Electron (i.e. in your case just nfc-pcsc) with the following command: electron-rebuild -f -w nfc-pcsc
  3. run the app
  4. rebuild native modules with the command above whenever you install/upgrade/uninstall any modules

The best practice is to have electron-rebuild installed as devDependency of your project and then add the rebuild script to the scripts section of the package.json.

I made all the changes (and a few more) and created a PR madsbrydegaard/electron-pcsc#1 in your repo. πŸš€

Please do the following:

  1. Merge it in GitHub
  2. Pull the changes using git pull
  3. Delete node_modules
  4. Install dependencies with npm install
  5. Rebuild the dependencies with npm run rebuild (Don't forget the run word!)
  6. Run the app with npm start

Please let me know if it works for you.

Hope it helps. πŸ™‚


PS Don't forget to star ⭐️my library, if you find it useful. πŸ˜ƒThanks.

from nfc-pcsc.

madsbrydegaard avatar madsbrydegaard commented on July 28, 2024

@pokusew - that solved the problem. Thnx a lot!
I think that I previously failed to compile nfc-pcsc correctly for electron but following your steps did the trick.
Also my cardreader and card shows up (and down) as expected.

However I get an error when reading card data - I might get back on that in another tread.

Your the man ;)
Thnx again

from nfc-pcsc.

pokusew avatar pokusew commented on July 28, 2024

@madsbrydegaard That's great! πŸ‘I am closing the issue now.

Feel free to open another one if you encounter any issues while reading/writing card data. πŸ˜‰

Also be sure to check out the nfc-pcsc examples, where you can find many useful info on reading and writing card data. πŸ™‚

from nfc-pcsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.