Code Monkey home page Code Monkey logo

Comments (32)

santigimeno avatar santigimeno commented on June 8, 2024

@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.

mn1aC avatar mn1aC commented on June 8, 2024

What with mac?

apt-get install libpcsclite1 libpcsclite-dev

will not work on mac...

from node-pcsclite.

LudovicRousseau avatar LudovicRousseau commented on June 8, 2024

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.

mn1aC avatar mn1aC commented on June 8, 2024

So from what i'm reading the current version should work on Win and Mac OS X?

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

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.

mn1aC avatar mn1aC commented on June 8, 2024

I'm using node-webkit (nwjs.io)..

from node-pcsclite.

santigimeno avatar santigimeno commented on June 8, 2024

@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 the attached_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.

mn1aC avatar mn1aC commented on June 8, 2024

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.

mn1aC avatar mn1aC commented on June 8, 2024

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.

mn1aC avatar mn1aC commented on June 8, 2024

Ok so the unistd.h is not supported on windows it's a unix thing...

http://stackoverflow.com/questions/22705751/cannot-open-include-file-unistd-h-no-such-file-or-directory

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

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.

santigimeno avatar santigimeno commented on June 8, 2024

@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.

mn1aC avatar mn1aC commented on June 8, 2024

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.

santigimeno avatar santigimeno commented on June 8, 2024

Yeah, that error makes more sense. I have updated the attached_threads branch. Can you try again? Thanks!

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

@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.

santigimeno avatar santigimeno commented on June 8, 2024

@mn1aC Thanks for the info. A couple of things:

  • Can I see the output of npm ls inside the pcsclite module?
  • Can you simply try to build the pcsclite outside the nw environment? (just using npm ,node-gyp)

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

`[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.

mn1aC avatar mn1aC commented on June 8, 2024

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.

mn1aC avatar mn1aC commented on June 8, 2024

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.

mn1aC avatar mn1aC commented on June 8, 2024

in pcsclite folder:
node-gyp configure (OK)
node-gyp build (OK)

so it seems node-webkit needs something different?

from node-pcsclite.

santigimeno avatar santigimeno commented on June 8, 2024

@mn1aC I have made a small modification in the attached_threads branch. Can you try again?

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

@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.

mn1aC avatar mn1aC commented on June 8, 2024

@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.

santigimeno avatar santigimeno commented on June 8, 2024

npm rebuild?

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

Same problem (I did the npm rebuild in the main folder)

from node-pcsclite.

santigimeno avatar santigimeno commented on June 8, 2024

Seems odd to me. Can you try to find a buffertools.node file in the node_modules source tree?

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

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.

santigimeno avatar santigimeno commented on June 8, 2024

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 outside nw and see if it works.
  • Try buffertools only in nw and see if it works.
  • etc.

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

Ok I'll keep looking and post my findings here.

from node-pcsclite.

santigimeno avatar santigimeno commented on June 8, 2024

@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.

mn1aC avatar mn1aC commented on June 8, 2024

Running! Thanks for help! 👍

from node-pcsclite.

mn1aC avatar mn1aC commented on June 8, 2024

Now I need to look into belgium eID cards, don't know how to talk to them..

from node-pcsclite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.