Closed mn1aC closed 9 years ago
@mn1aC Hi! Sorry for the delay. I somehow missed the notification. I've this PR: https://github.com/santigimeno/node-pcsclite/pull/24 that should allow to use this module in windows. See: https://github.com/santigimeno/node-pcsclite/issues/17. Still I haven't been able to test it thoroughly. If you could test it if works for you it'd be great!
What with mac?
apt-get install libpcsclite1 libpcsclite-dev
will not work on mac...
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
So from what i'm reading the current version should work on Win and Mac OS X?
I don's see any installation procedure for Mac OS X at http://ludovicrousseau.blogspot.fr/2014/09/pcsc-sample-in-javascript-nodejs.html
I'm using node-webkit (nwjs.io)..
@mn1aC The current status of the module is:
0.3.6
). Implemented in the attached_threads
branch. See: https://github.com/santigimeno/node-pcsclite/pull/24. I'll try to merge it as soon as I can test it properly. Some help would be appreciatedOk @santigimeno I'm going to start looking into windows and after that try it on Mac. I'll post my findings here...
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]
Ok so the unistd.h is not supported on windows it's a unix thing...
With node-gyp instead of nw-gyp it's the same error I'm getting
Any idea's how to move forward?
@mn1aC It looks to me you're using the code from master
and not from the attached_threads
branch as explained in https://github.com/santigimeno/node-pcsclite/issues/30#issuecomment-84328848
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
Yeah, that error makes more sense. I have updated the attached_threads
branch. Can you try again? Thanks!
@santigimeno with the adjusted branch attached_threads I get the following...
nw-gyp rebuild -msvsversion=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]
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`@mn1aC Thanks for the info. A couple of things:
npm ls
inside the pcsclite
module?pcsclite
outside the nw
environment? (just using npm
,node-gyp
)`pcsclite@0.3.6 C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite ├── UNMET DEPENDENCY bindings@^1.1.0 ├── UNMET DEPENDENCY buffertools@^2.1.2 └── nan@1.7.0
npm ERR! missing: buffertools@^2.1.2, required by pcsclite@0.3.6 npm ERR! missing: bindings@^1.1.0, required by pcsclite@0.3.6`
Now I did
npm install buffertools npm install bindings
npm ls gives
pcsclite@0.3.6 C:\Users\Electro Cornelis\Desktop\nw\nw\nw\node_modules\pcsclite ├── bindings@1.2.1 ├── buffertools@2.1.2 └── nan@1.7.0
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]
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`in pcsclite folder: node-gyp configure (OK) node-gyp build (OK)
so it seems node-webkit needs something different?
@mn1aC I have made a small modification in the attached_threads
branch. Can you try again?
@santigimeno build worked now. :+1: 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)
@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?
npm rebuild
?
Same problem (I did the npm rebuild in the main folder)
Seems odd to me. Can you try to find a buffertools.node
file in the node_modules
source tree?
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)
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:
pcsclite
outside nw
and see if it works.buffertools
only in nw
and see if it works.Ok I'll keep looking and post my findings here.
@mn1aC Just to be sure:
attached_threads
branch somewhere.npm install path-to-pcsclite-module
. This command should install and build the module.Running! Thanks for help! :+1:
Now I need to look into belgium eID cards, don't know how to talk to them..
Does this work on windows?