Comments (7)
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.
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.
Hi @madsbrydegaard,
Please try the following:
- Ensure the the NFC reader is connected to the computer, before starting the app
- Start the app
- 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.
- 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.
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.
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:
- install the dependencies
- 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
- run the app
- 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:
- Merge it in GitHub
- Pull the changes using
git pull
- Delete node_modules
- Install dependencies with
npm install
- Rebuild the dependencies with
npm run rebuild
(Don't forget the run word!) - 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.
@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.
@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)
- Constructing APDU command on NTAG21x
- Error when writing data. Receives an Invalid data length error. HOT 3
- Authentication failed for same blocks BUT is Working in others HOT 1
- P2P Feature
- Empty Data
- Multi RFID Reader
- was compiled against a different Node.js version using NODE_MODULE_VERSION 111. This version of Node.js requires NODE_MODULE_VERSION 110. HOT 3
- UnhandledPromiseRejectionWarning: WriteError: Write operation failed: Status code: 0x6300 HOT 3
- I don't understand that code HOT 1
- Module not found: Error: Can't resolve 'fs' HOT 2
- Unable to run the basic example HOT 2
- Add disposition parameter in disconnect method
- MacOS installation issue using npm HOT 2
- Cannot access "events.EventEmitter" in client code HOT 4
- Context Aware Native Module, Electron Context Isolation and Node Integration Support
- Unsupported engine Please Help
- Emulate Tag NFC?
- Sveltekit build fails when running 'npm run build' but works on 'npm run dev' HOT 1
- It turned out to connect the library in CRA(React)? HOT 1
- Writes become slower each time
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 nfc-pcsc.