pokusew / nfc-pcsc

Easy reading and writing NFC tags and cards in Node.js
MIT License
531 stars 131 forks source link

Native building issue using Electron #38

Open spawnrider opened 6 years ago

spawnrider commented 6 years ago

Hi,

I am attempting to build an electron app using NFC-PCSC lib. There is an issue when rebuilding the library using electron-rebuild :

gyp info it worked if it ends with ok gyp info using node-gyp@3.6.2 gyp info using node@8.9.1 | win32 | x64 gyp info spawn C:\Users\yciurlik.windows-build-tools\python27\python.exe gyp info spawn args [ 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-G', gyp info spawn args 'msvs_version=2015', gyp info spawn args '-I', gyp info spawn args 'C:\Users\yciurlik\Documents\PROJETS_CAP\DCX\AVV\16 - Chanel Refull\poc\node_modules\@pokusew\pcsclite\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\yciurlik\.electron-gyp\iojs-1.8.3\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\Users\yciurlik\.electron-gyp\iojs-1.8.3', gyp info spawn args '-Dnode_gyp_dir=C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\Users\yciurlik\.electron-gyp\iojs-1.8.3\<(target_arch)\iojs.lib', gyp info spawn args '-Dmodule_root_dir=C:\Users\yciurlik\Documents\PROJETS_CAP\DCX\AVV\16 - Chanel Refull\poc\node_modules\@pokusew\pcsclite', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'C:\Users\yciurlik\Documents\PROJETS_CAP\DCX\AVV\16 - Chanel Refull\poc\node_modules\@pokusew\pcsclite\build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe gyp info spawn args [ 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' ] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\yciurlik\Documents\PROJETS_CAP\DCX\AVV\16 - Chanel Refull\poc\node_modules\@pokusew\pcsclite gyp ERR! node -v v8.9.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok error An unexpected error occurred: "Command failed. Exit code: 1

Version:

You'll find the full log attached. Thanks a lot for your help.

pokusew commented 6 years ago

Hi @spawnrider,

thank you for posting your issue here. 🙂 Sorry, for the late response. I've been quite busy.

From the log you attached, it seems that node-gyp rebuild command fails. I think it may be caused by some incompatibility of node-gyp with the current version of Windows.

Anyway, it should work. I normally use nfc-pcsc in Electron and I am able to build it for Windows, too. So there must just some version incompatibility.

Are you able to install nfc-pcsc without problems? If yes, then the problem must be connected to electron-rebuild. We could try to run node-gyp rebuild command directly (I'll post it here).

I'll look at it more in the afternoon. I'll be online on chat today around 15:00 UTC, so we can try to solve it. I believe, together we will find the solution.

Hope it helps. 🙂