jfromaniello / node-windows-eventlog

Native node.js module to log messages to the Windows EventLog
http://jfromaniello.github.com/windowseventlogjs
48 stars 14 forks source link

Code no longer compiles on Visual Studio 2017 #16

Open franck-nadeau opened 5 years ago

franck-nadeau commented 5 years ago

I cannot compile windows-eventlog on my system.

npm install yields the following error:

...\node_modules\windows-eventlog\src\eventlog.cpp(110): error C2661: 'v8::Function::NewInstance': no overloaded function takes 2 arguments [...\node_modules\windows-eventlog\build\EventLog.vcxproj]

node -v v10.9.0

0x7f commented 5 years ago

@franck-nadeau sorry for the long delay. Just tried compiling the project with Visual Studio 2015 and 2017. Actually both compile just fine. Some warnings about deprecated functions are printed which I will try to updated asap. Do you have a reproducible example project? Can you please also provide the environment variables?

chelliwell commented 5 years ago

I'm having the exact same error (using VS 2015 at the moment). From a bit of searching and reading, I think the problem is to do with the version of Node i.e. 10.x.x - from what I can make out, there were changes to nan for Node 10 and this is what has caused the incompatibility with this project? I'm still getting to grips with node-gyp, let alone nan, so I don't know if you'd be able to spot an easy fix for this? Thanks

chelliwell commented 5 years ago

Ah-ha. It seems a fairly simple fix, changing that line to info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); For info I'm using node v10.15.3 and nan 2.14.0 It would be great if you could update and release a new npm. ('Fraid I can't confidently figure out the minimum [stable] nan version for that change to its API)

chelliwell commented 5 years ago

It would be great if you could update and release a new npm. ('Fraid I can't confidently figure out the minimum [stable] nan version for that change to its API)

Haha, it seems you already know that! https://github.com/jfromaniello/node-windows-eventlog/commit/4c9dca28ec921d1e1eba9fe8695af3711c56ba4a Is it just then that a new npm is needed?

jfromaniello commented 1 year ago

Can you try v3 of this module? Thanks

chelliwell commented 1 year ago

Can you try v3 of this module? Thanks

I'm afraid I probably can't replicate the original error in order to check - I've since moved to a later VS version

EugenDueck commented 1 year ago

The problem

...\node_modules\windows-eventlog\src\eventlog.cpp(110): error C2661: 'v8::Function::NewInstance': no overloaded function takes 2 arguments [...\node_modules\windows-eventlog\build\EventLog.vcxproj]

should be due to a mismatch between windows-eventlog and the node.js version, unrelated to the VS version.

Anyways, more than 4 years have passed since this issues has been reported, so few people will want to build against the node.js version 10, which entered the EOL phase quite some time ago...