Comments (32)
@mn1aC Hi! Sorry for the delay. I somehow missed the notification.
I've this PR: #24 that should allow to use this module in windows. See: #17. Still I haven't been able to test it thoroughly. If you could test it if works for you it'd be great!
from node-pcsclite.
What with mac?
apt-get install libpcsclite1 libpcsclite-dev
will not work on mac...
from node-pcsclite.
node-pcsclite should work on Mac OS X. But the installation procedure is different.
See http://ludovicrousseau.blogspot.fr/2014/09/pcsc-sample-in-javascript-nodejs.html
from node-pcsclite.
So from what i'm reading the current version should work on Win and Mac OS X?
from node-pcsclite.
I don's see any installation procedure for Mac OS X at http://ludovicrousseau.blogspot.fr/2014/09/pcsc-sample-in-javascript-nodejs.html
from node-pcsclite.
I'm using node-webkit (nwjs.io)..
from node-pcsclite.
@mn1aC The current status of the module is:
- Linux: I have a couple of applications in production and have been working correctly for more than a year.
- Mac OS X: thanks to the help of @LudovicRousseau and others, I know it works. I don't know how stable it is as I don't work in that platform. To make it work in Max OS X I think you have to activate the pcscd service, I think there was a blogpost from @LudovicRousseau explaining how to do that but I can't find the link now.
- Windows: no support in the last published version (
0.3.6
). Implemented in theattached_threads
branch. See: #24. I'll try to merge it as soon as I can test it properly. Some help would be appreciated
from node-pcsclite.
Ok @santigimeno I'm going to start looking into windows and after that try it on Mac.
I'll post my findings here...
from node-pcsclite.
npm install pcsclite (failed)...
I downloaded the folder from git and extracted it in node_modules/pcsclite
nw-gyp rebuild --msvs_version=2013
failed, because 'nan' was not found.
So I did: npm install nan (in the node_modules/pcsclite folder)
Retry: nw-gyp rebuild --msvs_version=2013
But still cannot compile for node-webkit on windows..
Error:
..\src\pcsclite.cpp(1): fatal error C1083: Cannot open include file: 'unistd.h' : No such file or directory [C:\Users\User\Desktop\nw\nw\nw\node_mo dules\pcsclite\build\pcsclite.vcxproj] c:\users\User\desktop\nw\nw\nw\node_modules\pcsclite\src\cardreader .h(7): fatal error C1083: Cannot open include file: 'pthread.h': No such file o r directory (..\src\cardreader.cpp) [C:\Users\User\Desktop\nw\nw\nw \node_modules\pcsclite\build\pcsclite.vcxproj] c:\users\User\desktop\nw\nw\nw\node_modules\pcsclite\src\pcsclite.h (53): error C2146: syntax error : missing ';' before identifier 'm_status_threa d' (..\src\addon.cpp) [C:\Users\User\Desktop\nw\nw\nw\node_modules\ pcsclite\build\pcsclite.vcxproj] c:\users\User\desktop\nw\nw\nw\node_modules\pcsclite\src\pcsclite.h (53): error C4430: missing type specifier - int assumed. Note: C++ does not sup port default-int (..\src\addon.cpp) [C:\Users\User\Desktop\nw\nw\nw \node_modules\pcsclite\build\pcsclite.vcxproj] c:\users\User\desktop\nw\nw\nw\node_modules\pcsclite\src\pcsclite.h (54): error C2146: syntax error : missing ';' before identifier 'm_mutex' (..\s rc\addon.cpp) [C:\Users\User\Desktop\nw\nw\nw\node_modules\pcsclite \build\pcsclite.vcxproj] c:\users\User\desktop\nw\nw\nw\node_modules\pcsclite\src\pcsclite.h (54): error C4430: missing type specifier - int assumed. Note: C++ does not sup port default-int (..\src\addon.cpp) [C:\Users\User\Desktop\nw\nw\nw \node_modules\pcsclite\build\pcsclite.vcxproj] c:\users\User\desktop\nw\nw\nw\node_modules\pcsclite\src\cardreader .h(7): fatal error C1083: Cannot open include file: 'pthread.h': No such file o r directory (..\src\addon.cpp) [C:\Users\User\Desktop\nw\nw\nw\node _modules\pcsclite\build\pcsclite.vcxproj]
from node-pcsclite.
Ok so the unistd.h is not supported on windows it's a unix thing...
from node-pcsclite.
With node-gyp instead of nw-gyp it's the same error I'm getting
Any idea's how to move forward?
from node-pcsclite.
@mn1aC It looks to me you're using the code from master
and not from the attached_threads
branch as explained in #30 (comment)
from node-pcsclite.
Downloaded https://github.com/santigimeno/node-pcsclite/tree/attached_threads
nw-gyp rebuild --msvs_version=2013
failed, because 'nan' was not found.
So I did: npm install nan (in the node_modules/pcsclite folder)
Retry: nw-gyp rebuild --msvs_version=2013
But still cannot compile for node-webkit on windows..
..\src\pcsclite.cpp(1): fatal error C1083: Cannot open include file: 'unistd.h' : No such file or directory [C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_mo dules\pcsclite\build\pcsclite.vcxproj] gyp ERR! build error gyp ERR! stack Error:
C:\Program Files\MSBuild\12.0\bin\msbuild.exefailed wit h exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\Electro Cornelis\AppData\Roa ming\npm\node_modules\nw-gyp\lib\build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067 :12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\\Users\\Electro Cornelis\\AppData\\Roaming\\npm\\nod e_modules\\nw-gyp\\bin\\nw-gyp.js" "rebuild" "--msvs_version=2013" gyp ERR! cwd C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite gyp ERR! node -v v0.12.0 gyp ERR! nw-gyp -v v0.12.4 gyp ERR! not ok
from node-pcsclite.
Yeah, that error makes more sense. I have updated the attached_threads
branch. Can you try again? Thanks!
from node-pcsclite.
@santigimeno with the adjusted branch attached_threads I get the following...
nw-gyp rebuild -msvs_version=2013
`* CIL library ( CIL module *) : error LNK2005: "public: __thiscall v8::Escapa
bleHandleScope::~EscapableHandleScope(void)" (??1EscapableHandleScope@v8@@QAE@X
Z) already defined in nw.lib(nw.exe) [C:\Users\Electro Cornelis\Desktop\nw\nw\n
w\node_modules\pcsclite\build\pcsclite.vcxproj]
- CIL library ( CIL module *) : error LNK2005: "public: static class v8::Func
tion * __cdecl v8::Function::Cast(class v8::Value *)" (?Cast@Function@v8@@Sapav
12@PAVValue@2@@z) already defined in nw.lib(nw.exe) [C:\Users\Electro Cornelis
Desktop\nw\nw\nw\node_modules\pcsclite\build\pcsclite.vcxproj] - CIL library ( CIL module *) : error LNK2005: "public: void * __thiscall v8:
:Object::GetAlignedPointerFromInternalField(int)" (?GetAlignedPointerFromIntern
alField@Object@v8@@QAEPAXH@Z) already defined in nw.lib(nw.exe) [C:\Users\Elect
ro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite\build\pcsclite.vcxproj] - CIL library ( CIL module *) : error LNK2005: "public: void __thiscall v8::T
emplate::Set(class v8::Isolate *,char const *,class v8::Handle)
" (?Set@Template@v8@@QAEXPAVIsolate@2@PBDV?$Handle@VData@v8@@@2@@z) already def
ined in nw.lib(nw.exe) [C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules
\pcsclite\build\pcsclite.vcxproj]
C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite\build\Release
pcsclite.node : fatal error LNK1169: one or more multiply defined symbols found
[C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite\build\pcscli
te.vcxproj]
gyp ERR! build error
gyp ERR! stack Error:C:\Program Files\MSBuild\12.0\bin\msbuild.exe
failed wit
h exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Electro Cornelis\AppData\Roa
ming\npm\node_modules\nw-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067
:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Users\Electro Cornelis\AppData\Roaming\npm\nod
e_modules\nw-gyp\bin\nw-gyp.js" "rebuild" "--msvs_version=2013"
gyp ERR! cwd C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite
gyp ERR! node -v v0.12.0
gyp ERR! nw-gyp -v v0.12.4
gyp ERR! not ok`
from node-pcsclite.
@mn1aC Thanks for the info. A couple of things:
- Can I see the output of
npm ls
inside thepcsclite
module? - Can you simply try to build the
pcsclite
outside thenw
environment? (just usingnpm
,node-gyp
)
from node-pcsclite.
`[email protected] C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite
├── UNMET DEPENDENCY bindings@^1.1.0
├── UNMET DEPENDENCY buffertools@^2.1.2
└── [email protected]
npm ERR! missing: buffertools@^2.1.2, required by [email protected]
npm ERR! missing: bindings@^1.1.0, required by [email protected]`
from node-pcsclite.
Now I did
npm install buffertools
npm install bindings
npm ls gives
[email protected] C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite ├── [email protected] ├── [email protected] └── [email protected]
from node-pcsclite.
Went into node_modules/pcsclite/node_modules/bindings and did nw-gyp rebuild -msvs_version=2013 (failed)
Went into node_modules/pcsclite/node_modules/buffertools and did nw-gyp rebuild -msvs_version=2013 (worked)
in the node_modules/pcsclite folder nw-gyp rebuild -msvs_version=2013
Error
`* CIL library ( CIL module *) : error LNK2005: "public: __thiscall v8::Escapa
bleHandleScope::~EscapableHandleScope(void)" (??1EscapableHandleScope@v8@@QAE@X
Z) already defined in nw.lib(nw.exe) [C:\Users\Electro Cornelis\Desktop\nw\nw\n
w\node_modules\pcsclite\build\pcsclite.vcxproj]
- CIL library ( CIL module *) : error LNK2005: "public: static class v8::Func
tion * __cdecl v8::Function::Cast(class v8::Value *)" (?Cast@Function@v8@@Sapav
12@PAVValue@2@@z) already defined in nw.lib(nw.exe) [C:\Users\Electro Cornelis
Desktop\nw\nw\nw\node_modules\pcsclite\build\pcsclite.vcxproj] - CIL library ( CIL module *) : error LNK2005: "public: void * __thiscall v8:
:Object::GetAlignedPointerFromInternalField(int)" (?GetAlignedPointerFromIntern
alField@Object@v8@@QAEPAXH@Z) already defined in nw.lib(nw.exe) [C:\Users\Elect
ro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite\build\pcsclite.vcxproj] - CIL library ( CIL module *) : error LNK2005: "public: void __thiscall v8::T
emplate::Set(class v8::Isolate *,char const *,class v8::Handle)
" (?Set@Template@v8@@QAEXPAVIsolate@2@PBDV?$Handle@VData@v8@@@2@@z) already def
ined in nw.lib(nw.exe) [C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules
\pcsclite\build\pcsclite.vcxproj]
C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite\build\Release
pcsclite.node : fatal error LNK1169: one or more multiply defined symbols found
[C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite\build\pcscli
te.vcxproj]
gyp ERR! build error
gyp ERR! stack Error:C:\Program Files\MSBuild\12.0\bin\msbuild.exe
failed wit
h exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Electro Cornelis\AppData\Roa
ming\npm\node_modules\nw-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067
:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Users\Electro Cornelis\AppData\Roaming\npm\nod
e_modules\nw-gyp\bin\nw-gyp.js" "rebuild" "-msvs_version=2013"
gyp ERR! cwd C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite
gyp ERR! node -v v0.12.0
gyp ERR! nw-gyp -v v0.12.4
gyp ERR! not ok`
from node-pcsclite.
in pcsclite folder:
node-gyp configure (OK)
node-gyp build (OK)
so it seems node-webkit needs something different?
from node-pcsclite.
@mn1aC I have made a small modification in the attached_threads
branch. Can you try again?
from node-pcsclite.
@santigimeno build worked now. 👍
I'm going to test if the cardreader works now ..
(downloaded attached_threads in folder node_modules/pcsclite)
(went into the folder pcsclite: npm install nan, npm install buffertools, npm install bindings)
(nw-gyp rebuild -msvs_version=2013)
from node-pcsclite.
@santigimeno in de nwjs code I added:
var pcsc = require('pcsclite'); alert("ok");
but I get the following error in console:
Uncaught Error: Cannot find module './build/Debug/buffertools.node'
module.js:329
Any idea's?
from node-pcsclite.
npm rebuild
?
from node-pcsclite.
Same problem (I did the npm rebuild in the main folder)
from node-pcsclite.
Seems odd to me. Can you try to find a buffertools.node
file in the node_modules
source tree?
from node-pcsclite.
I found the buffertools.node file in node_modules/pcsclite/node_modules/buffertools/build/Release folder. Changed the name from Release to Debug and tried again...
Uncaught Error: Invalid access to memorylocation
C:\Users\User\Desktop\nw\nw\nw\node_modules\pcsclite\node_modules\buffertools\build\Debug\buffertools.node (module.js:346)
from node-pcsclite.
This is weird, looking at the buffertools
code, first it should try to look into the Release
folder, then into the Debug
folder:
try {
var buffertools = require('./build/Release/buffertools.node');
} catch (e) {
var buffertools = require('./build/Debug/buffertools.node');
}
I don't know what's going on. You could try to narrow down the error:
- Try
pcsclite
outsidenw
and see if it works. - Try
buffertools
only innw
and see if it works. - etc.
from node-pcsclite.
Ok I'll keep looking and post my findings here.
from node-pcsclite.
@mn1aC Just to be sure:
- Download the
attached_threads
branch somewhere. - Go to you application root folder and run
npm install path-to-pcsclite-module
. This command should install and build the module. - Run your app
from node-pcsclite.
Running! Thanks for help! 👍
from node-pcsclite.
Now I need to look into belgium eID cards, don't know how to talk to them..
from node-pcsclite.
Related Issues (20)
- Fails to rebuild for electron 28+ (v8 12+) HOT 3
- Clean up branches on github
- Add a `ISO7816transmit` function close to the core implementation HOT 1
- How to switch from T0 to T1 without disconnecting ? HOT 7
- Error building on OS X HOT 3
- Get nfc tag uid HOT 3
- How do you list all readers, including internal ones? HOT 3
- Cannot install on windows (node 9.3 & npm 5.5.1) - HELP HOT 1
- electron and Ionic integration HOT 2
- Deprecated NAN API in use HOT 4
- Improper Handling of Response 6100 HOT 2
- Error: SCardTransmit error: Insufficient buffer with Expect Return length 0xFF HOT 1
- Electron fails to start pcsclite
- Can't compile it - Buffertools package went unmantained HOT 2
- Failed installation on OSX
- Bindings Errors in Vue.js HOT 1
- PCSC error SCardGetStatusChange error: The action was cancelled by an SCardCancel request. HOT 1
- Electron: Loading non-context-aware native module in renderer HOT 8
- Release memory that has been returned from the resource manager using the SCARD_AUTOALLOCATE (function SCardListReaders) HOT 1
- Implement SCardGetReaderDeviceInstanceId() function
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 node-pcsclite.