Remove bindings dependency (require the built addon directly because the build output location is well-known and constant)

Add note about a possible error and its solution to the README
Improve .editorconfig
Run tests in CI workflow
This commit is contained in:
Martin Endler
2020-02-23 18:09:39 +01:00
parent 5964da0836
commit dacf2a082f
8 changed files with 46 additions and 20 deletions

View File

@@ -42,6 +42,8 @@ Bindings over pcsclite to access Smart Cards. It works in **Linux**, **macOS** a
- [Disabling drivers to make pcsclite working on Linux](#disabling-drivers-to-make-pcsclite-working-on-linux)
- [Which Node.js versions are supported?](#which-nodejs-versions-are-supported)
- [Can I use this library in my React Native app?](#can-i-use-this-library-in-my-react-native-app)
- [Frequent errors](#frequent-errors)
- [Error: Cannot find module '../build/Release/pcsclite.node'](#error-cannot-find-module-buildreleasepcsclitenode)
- [License](#license)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -345,6 +347,34 @@ or in **Electron.js and NW.js** desktop apps. On the other hand, these requireme
On top of that, React Native does not contain any Node.js runtime.
## Frequent errors
### Error: Cannot find module '../build/Release/pcsclite.node'
@pokusew/pcsclite uses **Node Native Modules** (Node.js C++ Addon) to access PC/SC API (pcsclite).
The Node.js native C++ addon is built during installation via [node-gyp](https://github.com/nodejs/node-gyp)
(see package.json > scripts > [install](https://github.com/pokusew/node-pcsclite/blob/master/package.json#L37)).
When you see the error `Cannot find module '../build/Release/pcsclite.node'`, something probably
**went wrong during the installation**.
Follow the steps below to resolve your problem:
1. If **there are any errors** in the output of the `npm install` resp. `yarn install`,
* **ensure you meet all the requirements** described in the [Installation](#installation) section of this README.
Then try reinstalling @pokusew/pcsclite (npm uninstall / yarn remove and then npm install / yarn add).
* **If the problem persists**, [open a new issue](https://github.com/pokusew/node-pcsclite/issues/new)
and be sure to include the output of the `npm install` resp. `yarn install`
and the details about your platform, OS, Node.js version and npm/yarn version.
2. If **there are no errors** during the installation,
* then try reinstalling @pokusew/pcsclite (npm uninstall / yarn remove and then npm install / yarn add).
* If it does not help, then examine the contents of the folder `node_modules/@pokusew/pcsclite` in your project
(in case you installed @pokusew/pcsclite as a dependency). There should be a `build` folder with
a `Release` folder inside. In the `Release` folder, there should be a `pcsclite.node` file.
It is possible that this file is somewhere else. Whether you find the file somewhere or not,
please [open a new issue](https://github.com/pokusew/node-pcsclite/issues/new)
and describe the problem and be sure to include the details
about your platform, OS, Node.js version and npm/yarn version.
## License
[ISC](/LICENSE.md)