apihlaja / node-irsdk

iRacing SDK implementation for Node.js.
https://apihlaja.github.io/node-irsdk
MIT License
102 stars 55 forks source link

Electron support? #32

Open apihlaja opened 6 years ago

apihlaja commented 6 years ago

package.json has only node.js version defined at the moment. But Electron binaries are available too. Should figure out which versions of Electron actually work.

Dahara2012 commented 5 years ago

Im trying to make a node-irsdk + electron app happen, but im getting compatabilty issues. Is there a version of electron known to be working?

Dahara2012 commented 5 years ago

I made it work with electron 1.8.5

apihlaja commented 5 years ago

The latest release had electron binary for v57 ABI. node-abi suggests it should be compatible with electron 1.8.0 and 2.0.0.

But that's just prebuild binaries. Node.js binary is for v64 ABI so at least Electron 3.0.0 should work if you compile it yourself. There is guide for installing node.js build tools on windows: https://github.com/nodejs/node-gyp#on-windows

It seems there is some issue at the moment since builds have been failing last month: https://ci.appveyor.com/project/apihlaja/node-irsdk/history

I guess issue is some outdated dependencies, ie. prebuild-install or nan. I'll go thru open PRs to see if those fix the issue..

apihlaja commented 5 years ago

Ok, now there is a new release of node-irsdk with latest prebuild binaries: https://github.com/apihlaja/node-irsdk/releases

Let me know if you have compatabilty issues with newer versions still.

sabifa commented 5 years ago

Hi guys, I'm currently having a similar issue trying to get the package to work with an electron app.

After installing node-irsdk I get the error:

This relative module was not found:

  • ../build/Release/IrSdkNodeBindings in ./node_modules/node-irsdk/src/node-irsdk.js

I checked in explorer to see if the file is missing but its there. I also ran electron-rebuild (rebuild command for native modules, is this even native?) without any success.

My project currently runs electron version 4.1.5, an older project which runs 2.0.17 is working fine. Is there anything I can do to make it run?

Thx for any help 👍

sushi86 commented 5 years ago

Sorry, maybe dumb question, how to use these binary relases (IrSdkNodeBindings.node from node-irsdk-v2.1.5-electron-v69-win32-x64)?

I'm new to node / electron, tried: const addon = require('../../../../irsdk/IrSdkNodeBindings.node');

but got:

ERROR in ./irsdk/IrSdkNodeBindings.node 1:2
Module parse failed: Unexpected character '�' (1:2)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)

Not surprisingly npm install --save node-irsdk didnt work.

Im working with: https://github.com/maximegris/angular-electron in branch angular7 which is using: "electron": "4.0.0", (see: https://github.com/maximegris/angular-electron/blob/angular7/package.json)

apihlaja commented 5 years ago

You shouldn't be requiring that file yourself, that's handled by lib itself. For some reason, that doesn't work.

I'll take a look when I have time (next week maybe). It seems there is some things to catch up for me. This extension has worked since node.js v0.12 days without much work but it seems now there has been some changes. I'm not mainaining anything else related to node.js native addons so I'm a bit out of loop.

Earlier, I used bindings-module. I dont remember why I dropped it. That might be the first thing to try.

sushi86 commented 5 years ago

Thanks a lot for this fast answer <3 I will take a look. Would be really nice if you find the time for fixing that. But I can understand that other things have higher priority.

apihlaja commented 5 years ago

Finally, I managed to update nan and update binaries for node.js v12. I didnt test Electron yet but at least new version compiles now.

sabifa commented 5 years ago

Thx for the update Antti!

Unfortunately it still doesn't work for me no matter if I use electron or not. Still getting the same error:

This relative module was not found:
../build/Release/IrSdkNodeBindings in ./node_modules/node-irsdk/src/node-irsdk.js
sabifa commented 5 years ago

Just did some testing again and the error tells me that it somehow doesnt find the created .node file which is getting imported at line 1.

I cloned your repo and ran the commands npm run ready and npm run prebuild which both ran without any errors.

I also created a .js file (containing node-irsdk relevant code) which I ran with node index.js and it executed fine without any problems. Do you have any clue on where this problem could be located?

apihlaja commented 5 years ago

I was about to look it myself too finally today. I don't really have any idea what's causing the issue. I'll probably just try to use bindings-module again. I dropped that at some point because it looked like unnecessary dep. I didn't find any PRs or issues from it related to v12 or new Elecron so maybe it simply works 😅

apihlaja commented 5 years ago

Hmm.. I can't replicate the issue using Node.js v12

$ nvm install 12.6.0
$ nvm use 12.6.0

Attempt 1:

$ git clone git@github.com:apihlaja/node-irsdk.git
$ cd node-irsdk 
$ npm install
$ node

And in Node.js REPL

> const iracing = require('.').getInstance()
> iracing.telemetry

Attempt 2:

$ mkdir iracing-test && cd iracing-test && npm init -y
$ npm install node-irsdk
$ node

And then in REPL:

> const iracing = require('node-irsdk').getInstance()
> iracing.telemetry

And doing same in index.js works too so that's not a factor.

sabifa commented 5 years ago

I can run it fine if I use node to start the script as well but not if I want to use it in my vue.js project (error is not vue related I tried other frameworks as well)

https://github.com/sabifa/node-irsdk-vue Clone this install all dependencies and try to run it with the command npm run serve to reproduce the issue.

apihlaja commented 5 years ago

Isn't that purely browser-side code? That's not going to work: node-irsdk has to be running inside Node.js or Electron. With Node.js, it means you need some kind of http or websocket-server. With Electron, you can do same or use some of alternatives that Electron has.

There is heavily outdated example of how to do it with Node.js using Socket.io: https://github.com/apihlaja/node-irsdk-inspector

sabifa commented 5 years ago

I thought its good to try it without electron to determine if it's electron which is causing the issue. Nevertheless it also doesn't work with electron 😢

Clone this and try to install node-irsdk and use it - I'm getting the same error. (Electron + Vue.js + node-irsdk has worked a couple of months ago)

apihlaja commented 5 years ago

Electron-Vue-Boilerplate seems to be very tiny wrapper which runs normal browser app in Electron. You should have access to node-irsdk at least in backgroud.js but it looks like that's not even used in dev mode of the boilerplate.

sabifa commented 5 years ago

Oh my god, of course!

This is the reason because it worked in the past. I used another way to initialize the electron project, namely this. It uses node to start the electron app and oh wonder it just works!

Sorry for taking your time.. 😅 It is working now 👍

apihlaja commented 5 years ago

I tried to create a quick start based on the default electron quick start but I found this issue: https://github.com/prebuild/prebuild/issues/249

Ie. currently my prebuild binaries for Electron v5 binaries are actually for Node.js v5. That was causing some head scratching. I subbed the issue, I'll try to complete quick start when I have actually working binary easily available.

I guess electron-vue gets around that issues somehow by forcing rebuild.

sabifa commented 5 years ago

Not sure if thats related but I had to use electron-rebuild, after rebuilding it worked fine.

apihlaja commented 5 years ago

electron-rebuild doesn't seem to do anything, no matter what flags I give for it. It just happily says "Build Complete" without actually doing anything.

skaughtx0r commented 5 years ago

Any progress with this. I'm currently able to use node-irsdk with Electron 4.x and NodeJS 12 if I run electron-rebuild. Would be nice if it worked with 5.x

This is the error I get with Electron 5

Uncaught Error: The module '\\?\D:\src\node\iracing\node_modules\node-irsdk\build\Release\IrSdkNodeBindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (electron/js2c/asar.js:155)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:881)
    at Object.func [as .node] (electron/js2c/asar.js:155)
    at Module.load (internal/modules/cjs/loader.js:701)
    at tryModuleLoad (internal/modules/cjs/loader.js:633)
    at Function.Module._load (internal/modules/cjs/loader.js:625)
    at Module.require (internal/modules/cjs/loader.js:739)
    at require (internal/modules/cjs/helpers.js:14)
    at Object.<anonymous> (D:\src\node\iracing\node_modules\node-irsdk\src\node-irsdk.js:1)
    at Object.<anonymous> (D:\src\node\iracing\node_modules\node-irsdk\src\node-irsdk.js:49)
apihlaja commented 5 years ago

I think @sabifa confirmed it works with v5 now? The issue is that prebuilt binary is wrong, as described in that prebuild-issue. Ie. if you want to use v5, you have to compile it yourself: https://electronjs.org/docs/tutorial/using-native-node-modules

You probably has to somehow force rebuilding because provided binary doesnt work. npm_config_build_from_source parameter might do the trick.

sabifa commented 5 years ago

I can't confirm it right now as I'm on vacation but I think I didn't try electron v5 yet. Will do that when I'm back home and report back.

mike1233 commented 5 years ago

if this is of any help, i tried to get it to work on electron v6.0.1 together with electron-rebuild and so far it works just fine. You do have to manually rebuild using electron-rebuild. this is the boilerplate i used: https://github.com/electron/electron-quick-start

sushi86 commented 5 years ago

@mike1233 can you please provide some help with this? I checked out this quick start, run electron rebuild and tried to install node-irsdk, but still getting my old error message ("prebuild-install" not installed, and some python errors)

Would be really nice!

raicem commented 5 years ago

I've successfully rebuilt it for Electron ^6.1. Could not make it work for Electron v7 tho. All I did was this:

npm install --global --production windows-build-tools npm install --save-dev electron-rebuild

and

.\node_modules\.bin\electron-rebuild.cmd

iamisti commented 5 years ago

can we have this fixed for electron 7? Also why a node package has any electron references?

sabifa commented 4 years ago

So I tried it again today and I am also able to rebuild the package for Electron 6.1.5, Electron 7.x gives me an error.

Make sure to run the rebuild command already mentioned by @raicem

martinguder commented 4 years ago

Any news on that issue? Does it work again or is the prebuild still failing?

heimdallexus commented 4 years ago

Hey guys. Having the same error. Any news?

sabifa commented 4 years ago

Afaik electron 6 is the latest working version

szantner commented 4 years ago

Hey, I managed to make it work under Electron 8.x

In IrSdkBindingHelpers.cpp I added the following lines starting from line 49:

v8::Isolate* isolate = v8::Isolate::GetCurrent(); Local<Context> context = Context::New(isolate);

Also added the context as the first parameter on line 54:

arr->Set(context, i, convertTelemetryValueToObject(var, i));

After this yarn compiled the module without errors and it seems to be working. However when running the application the following warnings are present: Electron: Loading non-context-aware native module in renderer

So I would consider this as a quick and dirty fix. Unfortunately my knowledge of connecting cpp code to node is very limited to move forward with this.

heimdallexus commented 4 years ago

I got it working a couple of weeks ago. Take a look at https://github.com/apihlaja/node-irsdk/issues/86#issuecomment-619003310

kempsu commented 4 years ago

I am doing my first steps with electron and node-irsdk and I keep getting this error on "npm start" after installing und using node-irsdk:

image

Can someone walk me through this? Using:

edit: found out that electron-rebuild could potentially fix this issue. Unfortunately I am only receiving errors when trying to rebuild node-irsdk (for example rebuilding bcrypt works fine).

PS F:\Dev\electron-ir-test> electron-rebuild node-irsdk
× Rebuild Failed

An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.17.0 | win32 | x64
gyp info find Python using Python version 3.8.3 found at "C:\Python38\python.exe"
gyp info find VS using VS2017 (15.9.28307.1146) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python38\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\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   '-I',
gyp info spawn args   'F:\\Dev\\electron-ir-test\\node_modules\\node-irsdk\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\kevin\\.electron-gyp\\9.0.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\kevin\\.electron-gyp\\9.0.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\kevin\\\\.electron-gyp\\\\9.0.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=F:\\Dev\\electron-ir-test\\node_modules\\node-irsdk',
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   'F:\\Dev\\electron-ir-test\\node_modules\\node-irsdk\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [
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 info spawn args ]
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu erm�glichen, m�ssen Sie den Schalter "/m" hinzuf�gen.
  IrSdkNodeBindings.cpp
  IrSdkCommand.cpp
  IRSDKWrapper.cpp
  IrSdkBindingHelpers.cpp
  win_delay_load_hook.cc
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9116): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp)
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9124): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp)
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9116): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp)
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9124): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp)
f:\dev\electron-ir-test\node_modules\node-irsdk\src\cpp\irsdkbindinghelpers.cpp(52): error C2661: "v8::Object::Set": Keine �berladene Funktion akzeptiert 2 Argumente [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=9.0.0" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd F:\Dev\electron-ir-test\node_modules\node-irsdk
gyp ERR! node -v v12.17.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

Failed with exit code: 1

Error: gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.17.0 | win32 | x64
gyp info find Python using Python version 3.8.3 found at "C:\Python38\python.exe"
gyp info find VS using VS2017 (15.9.28307.1146) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python38\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\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   '-I',
gyp info spawn args   'F:\\Dev\\electron-ir-test\\node_modules\\node-irsdk\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\kevin\\.electron-gyp\\9.0.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\kevin\\.electron-gyp\\9.0.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\kevin\\\\.electron-gyp\\\\9.0.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=F:\\Dev\\electron-ir-test\\node_modules\\node-irsdk',
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   'F:\\Dev\\electron-ir-test\\node_modules\\node-irsdk\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [
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 info spawn args ]
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu erm�glichen, m�ssen Sie den Schalter "/m" hinzuf�gen.
  IrSdkNodeBindings.cpp
  IrSdkCommand.cpp
  IRSDKWrapper.cpp
  IrSdkBindingHelpers.cpp
  win_delay_load_hook.cc
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9116): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp)
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9124): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkBindingHelpers.cpp)
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9116): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp)
c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(9124): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp) [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
  c:\users\kevin\.electron-gyp\9.0.0\include\node\v8.h(7345): note: Siehe Deklaration von "v8::MicrotasksCompletedCallback" (Quelldatei wird kompiliert ..\src\cpp\IrSdkNodeBindings.cpp)
f:\dev\electron-ir-test\node_modules\node-irsdk\src\cpp\irsdkbindinghelpers.cpp(52): error C2661: "v8::Object::Set": Keine �berladene Funktion akzeptiert 2 Argumente [F:\Dev\electron-ir-test\node_modules\node-irsdk\build\IrSdkNodeBindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kevin\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=9.0.0" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd F:\Dev\electron-ir-test\node_modules\node-irsdk
gyp ERR! node -v v12.17.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

Failed with exit code: 1
    at SafeSubscriber._error (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\spawn-rx\lib\src\index.js:267:84)
    at SafeSubscriber.__tryOrUnsub (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.error (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:156:26)
    at Subscriber._error (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:92:26)
    at Subscriber.error (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:72:18)
    at MapSubscriber.Subscriber._error (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:92:26)
    at MapSubscriber.Subscriber.error (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:72:18)
    at SafeSubscriber._next (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\spawn-rx\lib\src\index.js:242:65)
    at SafeSubscriber.__tryOrUnsub (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.next (C:\Users\kevin\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\rxjs\internal\Subscriber.js:143:22)

SOLUTION:

#86 (comment)

Let's start with those steps and see if it helps:

  • fix deprecated set call on IrSdkBindingHelpers.cpp at 'convertTelemetryVarToObject' Nan::Set(arr, i, convertTelemetryValueToObject(var, i));
  • change import on node-irsdk.js var IrSdkNodeWrapper = require('../build/Release/IrSdkNodeBindings.node')
  • rebuild ./node_modules/.bin/electron-rebuild
martinguder commented 4 years ago

Did you even read at all? Sorry to say, but you literally seem to comment underneath the last answer, where the fix for rebuilding is posted.

kempsu commented 4 years ago

Thanks for your reply. Yes, I read all, but it seems that I might have missed some information there. I will give it a shot later today or tomorrow and report. Sorry for the inconvenience.

heimdallexus commented 4 years ago

Hi Kevin, just take a look at https://github.com/apihlaja/node-irsdk/issues/86#issuecomment-619003310. Hope it helps!

kempsu commented 4 years ago

Thank you @martinguder & @heimdallexus - I edited my initial comment to add the solution to make it a little easier for other people with the same issue. The mentioned solution works fine. Sorry that I did not read carefully enough it seems.

martinguder commented 4 years ago

Thanks. Sorry for being a bit harshly!