Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Add support for Node 12 #81

Merged
merged 8 commits into from
May 27, 2019
Merged

Add support for Node 12 #81

merged 8 commits into from
May 27, 2019

Conversation

kryops
Copy link
Contributor

@kryops kryops commented Apr 30, 2019

Closes #80

There seem to be multiple ways to fix the NumberValue error, not sure which is the best/correct one.

I also did not check how this might affect compatibility with older versions of Node.

Copy link
Owner

@MadLittleMods MadLittleMods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build is currently failing, https://travis-ci.org/MadLittleMods/node-usb-detection/builds/526592841

../src/detection.cpp:122:63: error: no member named 'ToChecked' in 'v8::Maybe<double>'
                        vid = (int) args[0]->NumberValue(Nan::GetCurrentContext()).ToChecked();

Do we need to update the nan dependency?


We should also add a Node.js 12 build to Travis and Appveyor,

@kryops
Copy link
Contributor Author

kryops commented May 1, 2019

Sorry for spamming commits here, it's a lot of trial and error 😅

The only replacement I found for args[i]->NumberValue() that compiles under all versions of Node seems to be Nan::To<int>(args[i]).FromJust(). I also found nan's official Node 12 upgrade tracker ticket: nodejs/nan#849

I tried adding Node 10 and 12 to Travis and AppVeyor, and ran into a few issues there:

@bnoordhuis
Copy link

FWIW, the ToChecked error will be fixed once nodejs/nan#852 is released.

@MadLittleMods
Copy link
Owner

MadLittleMods commented May 9, 2019

Thanks for the updates @kryops, all of the builds are green now ✅

Just to make sure and an extra set of eyes, have you sanity checked that the project works with Node.js v10 and Node.js v12?

@kryops
Copy link
Contributor Author

kryops commented May 9, 2019

Mhm, I'm all of a sudden getting a segfault in the start-delayed-stop-monitoring-exit-gracefully.js test now, and some other tests are flaky. This is independent of Node 10 or 12, and also occurs on the current master - maybe my machine isn't the best to test this on atm :-/

Using it in my project works fine though on Node 10, 11 and 12.

Test results:

Node 10

[michael@latitude node-usb-detection]$ node -v && npm test
v10.15.3

> [email protected] test /home/michael/git/node-usb-detection
> jasmine ./test/test.js

Randomized with seed 27214
Started
....Add/Insert or Remove a USB device
.Remove a USB device
.Add/Insert a USB device
.FF..

Failures:
1) usb-detection can exit gracefully after `startMonitoring` then an async delayed `stopMonitoring`
  Message:
    Failed
  Stack:
    Error: Failed
        at <Jasmine>
        at commandRunner.then.catch (/home/michael/git/node-usb-detection/test/test.js:157:11)
        at process._tickCallback (internal/process/next_tick.js:68:7)

2) usb-detection can exit gracefully after `startMonitoring` then `stopMonitoring`
  Message:
    Failed
  Stack:
    Error: Failed
        at <Jasmine>
        at commandRunner.then.catch (/home/michael/git/node-usb-detection/test/test.js:149:11)
        at process._tickCallback (internal/process/next_tick.js:68:7)

11 specs, 2 failures
Finished in 8.167 seconds
Randomized with seed 27214 (jasmine --random=true --seed=27214)
npm ERR! Test failed.  See above for more details.

Node 12

[michael@latitude node-usb-detection]$ node -v && npm test
v12.2.0

> [email protected] test /home/michael/git/node-usb-detection
> jasmine ./test/test.js

Randomized with seed 30116
Started
FF......Add/Insert or Remove a USB device
.Remove a USB device
.Add/Insert a USB device
.

Failures:
1) usb-detection can exit gracefully when SIGINT (Ctrl + c) after `startMonitoring`
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at <Jasmine>
        at listOnTimeout (internal/timers.js:531:17)
        at processTimers (internal/timers.js:475:7)

2) usb-detection can exit gracefully after `startMonitoring` then an async delayed `stopMonitoring`
  Message:
    Failed
  Stack:
    Error: Failed
        at <Jasmine>
        at /home/michael/git/node-usb-detection/test/test.js:157:11
        at processTicksAndRejections (internal/process/task_queues.js:89:5)

11 specs, 2 failures
Finished in 11.098 seconds
Randomized with seed 30116 (jasmine --random=true --seed=30116)
npm ERR! Test failed.  See above for more details.

I run Archlinux with a 5.0 Kernel and udev through systemd 242.19 - no idea what's going on there.

Here's the core dump of the segfault for completeness:

[michael@latitude node-usb-detection]$ gdb node dump
GNU gdb (GDB) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from node...(no debugging symbols found)...done.
[New LWP 6793]
[New LWP 6794]
[New LWP 6792]
[New LWP 6795]
[New LWP 6785]
[New LWP 6788]
[New LWP 6789]
[New LWP 6790]
[New LWP 6791]
[New LWP 6787]
[New LWP 6786]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `node test/fixtures/start-delayed-stop-monitoring-exit-gracefully.js'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ff3dcff109a in udev_monitor_receive_device () from /usr/lib/libudev.so.1
[Current thread is 1 (Thread 0x7ff3c7fff700 (LWP 6793))]
(gdb) bt
#0  0x00007ff3dcff109a in udev_monitor_receive_device () from /usr/lib/libudev.so.1
#1  0x00007ff3e2e1928b in cbWork (req=0x7ff3e2e1fe20 <work_req>) at ../src/detection_linux.cpp:229
#2  0x00007ff3e2bc3b0f in ?? () from /usr/lib/libuv.so.1
#3  0x00007ff3e202ea92 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007ff3e1f5ccd3 in clone () from /usr/lib/libc.so.6
(gdb) 

@MadLittleMods
Copy link
Owner

@kryops Are you running npm run rebuild when you switch between versions?

The relevant code for your segfault crash is here,

dev = udev_monitor_receive_device(mon);

Those tests were run on Ubuntu 16.04 in #46

I just ran the tests from master and this pull request on Ubuntu 18.04 with Node.js v10.15.3 and all of the can exit gracefully tests passed fine.


I tried building with Node.js v12.2.0 but I am running into errors:

Ubuntu 18.04, Node.js v12.2.0 `npm run rebuild`
$ npm run rebuild
 
> [email protected] rebuild /home/eric/Downloads/node-usb-detection
> node-gyp rebuild
 
make: Entering directory '/home/eric/Downloads/node-usb-detection/build'
  CXX(target) Release/obj.target/detection/src/detection.o
In file included from ../node_modules/nan/nan_converters.h:67:0,
                 from ../node_modules/nan/nan.h:202,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ToFactoryBase<v8::Boolean>::return_t Nan::imp::ToFactory<v8::Boolean>::convert(v8::Local<v8::Value>)’:
../node_modules/nan/nan_converters_43_inl.h:18:51: warning: ‘v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const’ is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
       val->To ## TYPE(isolate->GetCurrentContext())                            \
                                                   ^
../node_modules/nan/nan_converters_43_inl.h:22:1: note: in expansion of macro ‘X’
 X(Boolean)
 ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2524:63: note: declared here
                     V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
                                                               ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../node_modules/nan/nan_converters.h:67:0,
                 from ../node_modules/nan/nan.h:202,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ValueFactoryBase<bool>::return_t Nan::imp::ToFactory<bool>::convert(v8::Local<v8::Value>)’:
../node_modules/nan/nan_converters_43_inl.h:37:57: warning: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’ is deprecated: BooleanValue can never throw. Use Isolate version. [-Wdeprecated-declarations]
   return val->NAME ## Value(isolate->GetCurrentContext());                     \
                                                         ^
../node_modules/nan/nan_converters_43_inl.h:40:1: note: in expansion of macro ‘X’
 X(bool, Boolean)
 ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2562:51: note: declared here
                 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                   ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:307:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../node_modules/nan/nan_new.h:189:0,
                 from ../node_modules/nan/nan.h:203,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Function>::return_t Nan::imp::Factory<v8::Function>::New(Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan_implementation_12_inl.h:105:32: error: no matching function for call to ‘v8::Function::New(v8::Isolate*&, void (&)(const v8::FunctionCallbackInfo<v8::Value>&), v8::Local<v8::Object>&)’
                           , obj));
                                ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/node.h:63:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:4125:31: note: candidate: static v8::MaybeLocal<v8::Function> v8::Function::New(v8::Local<v8::Context>, v8::FunctionCallback, v8::Local<v8::Value>, int, v8::ConstructorBehavior, v8::SideEffectType)
   static MaybeLocal<Function> New(
                               ^~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:4125:31: note:   no known conversion for argument 1 from ‘v8::Isolate*’ to ‘v8::Local<v8::Context>’
In file included from ../node_modules/nan/nan_new.h:189:0,
                 from ../node_modules/nan/nan.h:203,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::StringObject>::return_t Nan::imp::Factory<v8::StringObject>::New(v8::Local<v8::String>)’:
../node_modules/nan/nan_implementation_12_inl.h:337:37: error: no matching function for call to ‘v8::StringObject::New(v8::Local<v8::String>&)’
   return v8::StringObject::New(value).As<v8::StringObject>();
                                     ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/node.h:63:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:5380:23: note: candidate: static v8::Local<v8::Value> v8::StringObject::New(v8::Isolate*, v8::Local<v8::String>)
   static Local<Value> New(Isolate* isolate, Local<String> value);
                       ^~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:5380:23: note:   candidate expects 2 arguments, 1 provided
In file included from ../node_modules/nan/nan_new.h:189:0,
                 from ../node_modules/nan/nan.h:203,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_implementation_12_inl.h:337:58: error: expected primary-expression before ‘>’ token
   return v8::StringObject::New(value).As<v8::StringObject>();
                                                          ^
../node_modules/nan/nan_implementation_12_inl.h:337:60: error: expected primary-expression before ‘)’ token
   return v8::StringObject::New(value).As<v8::StringObject>();
                                                            ^
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In constructor ‘Nan::Utf8String::Utf8String(v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:1034:53: error: no matching function for call to ‘v8::Value::ToString()’
       v8::Local<v8::String> string = from->ToString();
                                                     ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/node.h:63:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2528:44: note: candidate: v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2544:35: note: candidate: v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const
                     Local<String> ToString(Isolate* isolate) const);
                                   ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2544:35: note:   candidate expects 1 argument, 0 provided
                     Local<String> ToString(Isolate* isolate) const);
                                   ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h:1044:74: error: no matching function for call to ‘v8::String::WriteUtf8(char*&, int, int, const int&)’
         length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
                                                                          ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/node.h:63:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2738:7: note: candidate: int v8::String::WriteUtf8(v8::Isolate*, char*, int, int*, int) const
   int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
       ^~~~~~~~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2738:7: note:   no known conversion for argument 1 from ‘char*’ to ‘v8::Isolate*’
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const char*, const v8::Local<v8::Value>&)’:
../node_modules/nan/nan.h:1818:64: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
                                                                ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const v8::Local<v8::String>&, const v8::Local<v8::Value>&)’:
../node_modules/nan/nan.h:1824:42: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     New(persistentHandle)->Set(key, value);
                                          ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(uint32_t, const v8::Local<v8::Value>&)’:
../node_modules/nan/nan.h:1830:44: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     New(persistentHandle)->Set(index, value);
                                            ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3368:26: note: declared here
                     bool Set(uint32_t index, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const char*) const’:
../node_modules/nan/nan.h:1836:61: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
         New(persistentHandle)->Get(New(key).ToLocalChecked()));
                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3412:55: note: declared here
   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
                                                       ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const v8::Local<v8::String>&) const’:
../node_modules/nan/nan.h:1842:55: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     return scope.Escape(New(persistentHandle)->Get(key));
                                                       ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3412:55: note: declared here
   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
                                                       ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(uint32_t) const’:
../node_modules/nan/nan.h:1847:57: warning: ‘v8::Local<v8::Value> v8::Object::Get(uint32_t)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     return scope.Escape(New(persistentHandle)->Get(index));
                                                         ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3416:55: note: declared here
   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index));
                                                       ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/node_object_wrap.h:26,
                 from ../node_modules/nan/nan.h:53,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_object_wrap.h: In destructor ‘virtual Nan::ObjectWrap::~ObjectWrap()’:
../node_modules/nan/nan_object_wrap.h:24:25: error: ‘class Nan::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
     assert(persistent().IsNearDeath());
                         ^
In file included from ../node_modules/nan/nan.h:2657:0,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_object_wrap.h: In member function ‘void Nan::ObjectWrap::MakeWeak()’:
../node_modules/nan/nan_object_wrap.h:67:34: warning: ‘void v8::PersistentBase<T>::MarkIndependent() [with T = v8::Object]’ is deprecated: Weak objects are always considered independent. Use TracedGlobal when trying to use EmbedderHeapTracer. Use a strong handle when trying to keep an object alive. [-Wdeprecated-declarations]
     persistent().MarkIndependent();
                                  ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:567:22: note: declared here
       V8_INLINE void MarkIndependent());
                      ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:307:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from /usr/include/c++/7/cassert:44:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/node_object_wrap.h:26,
                 from ../node_modules/nan/nan.h:53,
                 from ../src/detection.h:13,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan_object_wrap.h: In static member function ‘static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’:
../node_modules/nan/nan_object_wrap.h:124:26: error: ‘class Nan::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
     assert(wrap->handle_.IsNearDeath());
                          ^
../src/detection.cpp: In function ‘void NotifyAdded(ListResultItem_t*)’:
../src/detection.cpp:51:113: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 em->Set(Nan::New<v8::String>(OBJECT_ITEM_LOCATION_ID).ToLocalChecked(), Nan::New<v8::Number>(it->locationId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:52:109: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   item->Set(Nan::New<v8::String>(OBJECT_ITEM_VENDOR_ID).ToLocalChecked(), Nan::New<v8::Number>(it->vendorId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:53:111: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 item->Set(Nan::New<v8::String>(OBJECT_ITEM_PRODUCT_ID).ToLocalChecked(), Nan::New<v8::Number>(it->productId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:54:138: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 ng>(OBJECT_ITEM_DEVICE_NAME).ToLocalChecked(), Nan::New<v8::String>(it->deviceName.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:55:141: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 (OBJECT_ITEM_MANUFACTURER).ToLocalChecked(), Nan::New<v8::String>(it->manufacturer.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:56:142: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 OBJECT_ITEM_SERIAL_NUMBER).ToLocalChecked(), Nan::New<v8::String>(it->serialNumber.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:57:119: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 t(Nan::New<v8::String>(OBJECT_ITEM_DEVICE_ADDRESS).ToLocalChecked(), Nan::New<v8::Number>(it->deviceAddress));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:60:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
   addedCallback->Call(1, argv);
                              ^
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h:1618:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
../src/detection.cpp: In function ‘void NotifyRemoved(ListResultItem_t*)’:
../src/detection.cpp:96:113: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 em->Set(Nan::New<v8::String>(OBJECT_ITEM_LOCATION_ID).ToLocalChecked(), Nan::New<v8::Number>(it->locationId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:97:109: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   item->Set(Nan::New<v8::String>(OBJECT_ITEM_VENDOR_ID).ToLocalChecked(), Nan::New<v8::Number>(it->vendorId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:98:111: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 item->Set(Nan::New<v8::String>(OBJECT_ITEM_PRODUCT_ID).ToLocalChecked(), Nan::New<v8::Number>(it->productId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:99:138: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 ng>(OBJECT_ITEM_DEVICE_NAME).ToLocalChecked(), Nan::New<v8::String>(it->deviceName.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:100:141: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 (OBJECT_ITEM_MANUFACTURER).ToLocalChecked(), Nan::New<v8::String>(it->manufacturer.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:101:142: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 OBJECT_ITEM_SERIAL_NUMBER).ToLocalChecked(), Nan::New<v8::String>(it->serialNumber.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:102:119: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 t(Nan::New<v8::String>(OBJECT_ITEM_DEVICE_ADDRESS).ToLocalChecked(), Nan::New<v8::Number>(it->deviceAddress));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:105:32: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
   removedCallback->Call(1, argv);
                                ^
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h:1618:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
../src/detection.cpp: In function ‘void Find(const Nan::FunctionCallbackInfo<v8::Value>&)’:
../src/detection.cpp:122:37: error: no matching function for call to ‘v8::Value::NumberValue()’
    vid = (int) args[0]->NumberValue();
                                     ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/node.h:63:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2564:39: note: candidate: v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
                                       ^~~~~~~~~~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2564:39: note:   candidate expects 1 argument, 0 provided
../src/detection.cpp:123:37: error: no matching function for call to ‘v8::Value::NumberValue()’
    pid = (int) args[1]->NumberValue();
                                     ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/node.h:63:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2564:39: note: candidate: v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
                                       ^~~~~~~~~~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2564:39: note:   candidate expects 1 argument, 0 provided
../src/detection.cpp:136:37: error: no matching function for call to ‘v8::Value::NumberValue()’
    vid = (int) args[0]->NumberValue();
                                     ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/node.h:63:0,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2564:39: note: candidate: v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
                                       ^~~~~~~~~~~
/home/eric/.node-gyp/12.2.0/include/node/v8.h:2564:39: note:   candidate expects 1 argument, 0 provided
../src/detection.cpp: In function ‘void EIO_AfterFind(uv_work_t*)’:
../src/detection.cpp:182:117: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 >Set(Nan::New<v8::String>(OBJECT_ITEM_LOCATION_ID).ToLocalChecked(), Nan::New<v8::Number>((*it)->locationId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:183:113: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 tem->Set(Nan::New<v8::String>(OBJECT_ITEM_VENDOR_ID).ToLocalChecked(), Nan::New<v8::Number>((*it)->vendorId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:184:115: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 m->Set(Nan::New<v8::String>(OBJECT_ITEM_PRODUCT_ID).ToLocalChecked(), Nan::New<v8::Number>((*it)->productId));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:185:142: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 (OBJECT_ITEM_DEVICE_NAME).ToLocalChecked(), Nan::New<v8::String>((*it)->deviceName.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:186:145: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 JECT_ITEM_MANUFACTURER).ToLocalChecked(), Nan::New<v8::String>((*it)->manufacturer.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:187:146: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 ECT_ITEM_SERIAL_NUMBER).ToLocalChecked(), Nan::New<v8::String>((*it)->serialNumber.c_str()).ToLocalChecked());
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:188:123: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 an::New<v8::String>(OBJECT_ITEM_DEVICE_ADDRESS).ToLocalChecked(), Nan::New<v8::Number>((*it)->deviceAddress));
                                                                                                             ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:189:24: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
    results->Set(i, item);
                        ^
In file included from /home/eric/.node-gyp/12.2.0/include/node/v8-internal.h:14:0,
                 from /home/eric/.node-gyp/12.2.0/include/node/v8.h:25,
                 from /home/eric/.node-gyp/12.2.0/include/node/node.h:63,
                 from ../src/detection.h:5,
                 from ../src/detection.cpp:1:
/home/eric/.node-gyp/12.2.0/include/node/v8.h:3368:26: note: declared here
                     bool Set(uint32_t index, Local<Value> value));
                          ^
/home/eric/.node-gyp/12.2.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/detection.cpp:195:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
  data->callback->Call(2, argv);
                              ^
In file included from ../src/detection.h:13:0,
                 from ../src/detection.cpp:1:
../node_modules/nan/nan.h:1618:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
../src/detection.cpp: At global scope:
../src/detection.cpp:213:17: error: variable or field ‘init’ declared void
  void init (v8::Handle<v8::Object> target) {
                 ^~~~~~
../src/detection.cpp:213:17: error: ‘Handle’ is not a member of ‘v8’
../src/detection.cpp:213:34: error: expected primary-expression before ‘>’ token
  void init (v8::Handle<v8::Object> target) {
                                  ^
../src/detection.cpp:213:36: error: ‘target’ was not declared in this scope
  void init (v8::Handle<v8::Object> target) {
                                    ^~~~~~
../src/detection.cpp:213:36: note: suggested alternative: ‘Start’
  void init (v8::Handle<v8::Object> target) {
                                    ^~~~~~
                                    Start
In file included from ../src/detection.h:5:0,
                 from ../src/detection.cpp:1:
../src/detection.cpp:223:24: error: ‘init’ was not declared in this scope
 NODE_MODULE(detection, init);
                        ^
/home/eric/.node-gyp/12.2.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
       (node::addon_register_func) (regfunc),                          \
                                    ^~~~~~~
../src/detection.cpp:223:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(detection, init);
 ^~~~~~~~~~~
../src/detection.cpp:223:24: note: suggested alternative: ‘int’
 NODE_MODULE(detection, init);
                        ^
/home/eric/.node-gyp/12.2.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
       (node::addon_register_func) (regfunc),                          \
                                    ^~~~~~~
../src/detection.cpp:223:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(detection, init);
 ^~~~~~~~~~~
detection.target.mk:109: recipe for target 'Release/obj.target/detection/src/detection.o' failed
make: *** [Release/obj.target/detection/src/detection.o] Error 1
make: Leaving directory '/home/eric/Downloads/node-usb-detection/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/eric/.nvm/versions/node/v12.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:257:12)
gyp ERR! System Linux 4.15.0-48-generic
gyp ERR! command "/home/eric/.nvm/versions/node/v12.2.0/bin/node" "/home/eric/.nvm/versions/node/v12.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/eric/Downloads/node-usb-detection
gyp ERR! node -v v12.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
 
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/eric/.npm/_logs/2019-05-09T22_38_17_418Z-debug.log
Windows 10, Node.js v12.2.0 `npm run rebuild`
$ npm run rebuild
> [email protected] rebuild C:\Users\MLM\Documents\GitHub\node-usb-detection
> node-gyp rebuild


C�L�I�N�K� ��[1;32;40mC:\Users\MLM\Documents\GitHub\node-usb-detection {git}{hg} 
�[1;30;40m{lamb} �[0mif not defined npm_config_node_gyp (node "C:\Users\MLM\AppData\Roaming\nvm\v12.2.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\MLM\AppData\Roaming\nvm\v12.2.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  detection.cpp
  deviceList.cpp
  detection_win.cpp
  win_delay_load_hook.cc
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_converters_43_inl.h(22): warning C4996: 'v8::Value::ToBoolean': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(2523): note: see declaration of 'v8::Value::ToBoolean' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_converters_43_inl.h(40): warning C4996: 'v8::Value::BooleanValue': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(2561): note: see declaration of 'v8::Value::BooleanValue' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(103): error C2664: 'v8::MaybeLocal<v8::Function> v8::Function::New(v8::Local<v8::Context>,v8::FunctionCallback,v8::Local<v8::Value>,int,v8::ConstructorBehavior,v8::SideEffectType)': cannot convert argument 1 from 'v8::Isolate *' to 'v8::Local<v8::Context>' (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(105): note: No constructor could take the source type, or constructor overload resolution was ambiguous (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(337): error C2660: 'v8::StringObject::New': function does not take 1 arguments (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(5380): note: see declaration of 'v8::StringObject::New' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(337): error C2059: syntax error: ')' (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1034): error C2661: 'v8::Value::ToString': no overloaded function takes 0 arguments (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1044): error C2664: 'int v8::String::WriteUtf8(v8::Isolate *,char *,int,int *,int) const': cannot convert argument 1 from 'char *' to 'v8::Isolate *' (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1044): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1818): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1824): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1830): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3367): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1836): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3412): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1842): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3412): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1847): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3416): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1859): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_object_wrap.h(67): warning C4996: 'v8::PersistentBase<v8::Object>::MarkIndependent': was declared deprecated (compiling source file ..\src\detection.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(563): note: see declaration of 'v8::PersistentBase<v8::Object>::MarkIndependent' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_object_wrap.h(124): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1859): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(51): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(52): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(53): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(54): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(55): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(56): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(57): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(60): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(96): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(97): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(98): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(99): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(100): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(101): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(102): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(105): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(122): error C2660: 'v8::Value::NumberValue': function does not take 0 arguments [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(2564): note: see declaration of 'v8::Value::NumberValue' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(123): error C2660: 'v8::Value::NumberValue': function does not take 0 arguments [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(2564): note: see declaration of 'v8::Value::NumberValue' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(136): error C2660: 'v8::Value::NumberValue': function does not take 0 arguments [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(2564): note: see declaration of 'v8::Value::NumberValue' (compiling source file ..\src\detection.cpp)
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(182): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(183): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(184): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(185): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(186): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(187): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(188): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(189): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3367): note: see declaration of 'v8::Object::Set'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(195): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(213): error C2039: 'Handle': is not a member of 'v8' [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8-platform.h(16): note: see declaration of 'v8'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(213): error C2065: 'Handle': undeclared identifier [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(213): error C2275: 'v8::Object': illegal use of this type as an expression [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(213): note: see declaration of 'v8::Object'
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(213): error C2065: 'target': undeclared identifier [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(213): error C2182: 'init': illegal use of type 'void' [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(213): error C2448: 'init': function-style initializer appears to be a function definition [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\src\detection.cpp(223): warning C4312: 'type cast': conversion from 'int' to 'node::addon_register_func' of greater size [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_converters_43_inl.h(22): warning C4996: 'v8::Value::ToBoolean': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(2523): note: see declaration of 'v8::Value::ToBoolean' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_converters_43_inl.h(40): warning C4996: 'v8::Value::BooleanValue': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(2561): note: see declaration of 'v8::Value::BooleanValue' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(103): error C2664: 'v8::MaybeLocal<v8::Function> v8::Function::New(v8::Local<v8::Context>,v8::FunctionCallback,v8::Local<v8::Value>,int,v8::ConstructorBehavior,v8::SideEffectType)': cannot convert argument 1 from 'v8::Isolate *' to 'v8::Local<v8::Context>' (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(105): note: No constructor could take the source type, or constructor overload resolution was ambiguous (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(337): error C2660: 'v8::StringObject::New': function does not take 1 arguments (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(5380): note: see declaration of 'v8::StringObject::New' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_implementation_12_inl.h(337): error C2059: syntax error: ')' (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1034): error C2661: 'v8::Value::ToString': no overloaded function takes 0 arguments (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1044): error C2664: 'int v8::String::WriteUtf8(v8::Isolate *,char *,int,int *,int) const': cannot convert argument 1 from 'char *' to 'v8::Isolate *' (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1044): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1818): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1824): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1830): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3367): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1836): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3412): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1842): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3412): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1847): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(3416): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection_win.cpp)
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1859): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_object_wrap.h(67): warning C4996: 'v8::PersistentBase<v8::Object>::MarkIndependent': was declared deprecated (compiling source file ..\src\detection_win.cpp) [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
  c:\users\mlm\.node-gyp\12.2.0\include\node\v8.h(563): note: see declaration of 'v8::PersistentBase<v8::Object>::MarkIndependent' (compiling source file ..\src\detection_win.cpp)
c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan_object_wrap.h(124): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\MLM\Documents\GitHub\node-usb-detection\build\detection.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection_win.cpp)
  c:\users\mlm\documents\github\node-usb-detection\node_modules\nan\nan.h(1859): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection_win.cpp)

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\MLM\AppData\Roaming\nvm\v12.2.0\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:257:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\MLM\\AppData\\Roaming\\nvm\\v12.2.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\MLM\Documents\GitHub\node-usb-detection
gyp ERR! node -v v12.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MLM\AppData\Roaming\npm-cache\_logs\2019-05-09T22_35_01_807Z-debug.log

@kryops
Copy link
Contributor Author

kryops commented May 11, 2019

Interesting 🤔

Yes, I did a full rm -rf node_modules && npm install && npm run rebuild after each version switch - not doing that would result in a "native module version mismatch" error anyway when running the tests.

I just tried to reproduce your build errors on my Windows 10 (Windows 10 Pro 1803, Version 10.0.17134 Build 17134) running Node v12.2.0, and both npm run rebuild and the tests run without errors.

Are you sure you were on this branch and had reinstalled the dependencies to get the latest version of nan before running npm run rebuild? Some of the errors you got look very similar to what I got trying to build master on Node 12.

@motla
Copy link

motla commented May 18, 2019

Thanks for this patch guys!

FYI, this PR builds and runs without hassle on my config:

  • macOS Mojave 10.14.4
  • Node v12.2.0
  • NPM v6.9.0
  • tested on Electron v4.2.2 and v5.0.1 using electron-rebuild

There are 25 warnings in src/detection.cpp indicating that functions 'Set' and 'Call' are now deprecated.

@MadLittleMods
Copy link
Owner

Re-tested with deleting node_modules/ and builds on Windows 10 and Ubuntu 18.04 with Node.js 12.2.0 properly 👍

@MadLittleMods MadLittleMods merged commit c537098 into MadLittleMods:master May 27, 2019
@MadLittleMods
Copy link
Owner

Thanks @kryops for the contribution ❤️! This will be part of [email protected]. I'll publish to npm after the prebuilds are ready from travis/appveyor 🚀

Thanks @motla for the extra testing!

@jordao76
Copy link

jordao76 commented Jun 2, 2019

Prebuilds not found for node 10, on windows:

> [email protected] install .\node_modules\usb-detection
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.16.0 runtime=node arch=x64 libc= platform=win32)

@MadLittleMods
Copy link
Owner

@jordao76 Can you create a new issue to track this?

@soumya05542
Copy link

soumya05542 commented Aug 31, 2019

I am still facing the following issue:

Error: The module '/opt/projects/workspace-edu-system/projects/electron-poc/node_modules/usb-detection/build/Release/detection.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing

I am using,
Electron: 6.0.5
Node version 12.x
usb-detection: 4.3.0

Please advise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node 12 support
6 participants