-
Notifications
You must be signed in to change notification settings - Fork 55
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
Uncaught Exception: Error: Cannot find module 'pcsclite' #20
Comments
Hi @flackjap, Thank you for posting your issue here. 🙂 I think, it's caused by incorrect module name in require statement. const pcsclite = require('@pokusew/pcsclite'); The module name must exactly match the name listed in package.js's dependencies section. Please let me know if you are able to make it work with the change above. BTW: Unfortunately, there was a mistake (missing BTW 2: 👀I highly recommend taking a look at nfc-pcsc which offers easy to use high level API for detecting / reading and writing NFC tags and cards. ✨It is much easier to work with, it has more documentation and more examples. (And it uses @pokusew/pcsclite under the hood.) Hope it helps. 🙂 PS Don't forget to star ⭐️my nfc-pcsc library, if you find it useful. 😃Thanks. |
Hi @pokusew , Yup, that was the issue :) Thanks for the recommendation about the nfc-pcsc, I will definitely take a look at it and give it a shot. Cheers! |
Hi @pokusew I notice you say that you have this library working with Electron. I am currently getting the the "cannot find module" error. Before this I was getting the Below is the code that I have in my Electron app. const pcsclite = require('@pokusew/pcsclite');
const pcsc = pcsclite();
pcsc.on('reader', (reader) => {
console.log('New reader detected', reader.name);
});
pcsc.on('error', err => {
console.log('PCSC error', err.message);
}); Do you think you'd be able to share a simple example of running this inside Electron? Many thanks. |
Hi,
This is the first time I'm building something with Electron.
Now, I read everything there is in the FAQ section and "Can I use this library in my Electron app?".
I tried everything from the Electron docs (Using Native Node Modules). The only thing I didn't try is "Manually building for a custom build of Electron" - since I'm not running a custom Electron build.
Things I tried:
No success.
I keep getting the following Uncaught Exception whenever I run the app (whether with "electron ." (npm start) or as a fully packaged app with electron-builder).
Sorry if I shouldn't post this here if this is the general problem with building native modules. I just cannot know if it is, since I tried googling and didn't find enough relatable issues, so it seemed to me that the problem might actually be with this module specifically.
This is my package.json:
The only thing I find a bit suspicious is the folder structure for this module, since it has two parent folders (node_modules/@pokusew/pcsclite/...), and that maybe some paths are misconfigured, but I don't know where to look or how to debug. I did however see at some stackoverflow comments that people are manually configuring some module paths in some cases, but I'm not sure how should I approach this, or even if I should be doing that.
Thanks in advance.
--
edit/update: Also tried manually copying the "pcsclite.node" from node_modules/@pokusew/pcsclite/build/Release" into the build folder of the project - still getting the same error.
The text was updated successfully, but these errors were encountered: