beyondscreen / node-rpi-ws281x-native

native bindings to drive WS2811 (or WS2812) LED-Controllers on a Raspberry Pi
MIT License
224 stars 101 forks source link

Fix build errors for Node.js v12 #98

Closed Granjow closed 4 years ago

Granjow commented 5 years ago

There are compilation errors on Node.js v12 like:

../src/rpi-ws281x.cc:87:52: error: no matching function for call to 'v8::Value::Int32Value()'
   ledstring.channel[0].count = info[0]->Int32Value();
                                                    ^
In file included from /root/.cache/node-gyp/12.8.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/rpi-ws281x.cc:1:
/root/.cache/node-gyp/12.8.0/include/node/v8.h:2576:40: note: candidate: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/root/.cache/node-gyp/12.8.0/include/node/v8.h:2576:40: note:   candidate expects 1 argument, 0 provided
../src/rpi-ws281x.cc:91:46: error: no matching function for call to 'v8::Value::ToObject()'
     Local<Object> config = info[1]->ToObject();

from functions which have been removed in this version.

An update would be very appreciated!

VTsuprov commented 4 years ago

Is it correct that there is no way to install the library with the latest version on NodeJS (>12.0)? At least I have tried all different forks and all ways of installing the library. Any time it was a fail with compilation

ckirmse commented 4 years ago

the latest version, 0.10, works with node 12 and higher. This issue should be resolved.

Granjow commented 4 years ago

Cool, thank you!