Closed iMarvinS closed 8 years ago
Here´s the output from node-gyp build
:
make: Entering directory '/root/test/nodejs_libmodbus/build'
CXX(target) Release/obj.target/modbus_binding/src/main.o
../src/main.cpp:22:32: error: 'Arguments' does not name a type
Handlemake
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.18.14-2-ARCH
gyp ERR! command "node" "/usr/bin/node-gyp" "build"
gyp ERR! cwd /root/test/nodejs_libmodbus
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
Same error.
Yes, looks like this module only supports node.js < 0.11. Unfortunately looks like there are major changes to the node.js (V8) internal APIs between 0.10 and 0.12.
I have the following using armhf and compiling on a RPI 1 with latest updated raspbian for the first function in main.cpp
Handle
gyp info it worked if it ends with ok gyp info using node-gyp@2.0.2 gyp info using node@0.12.6 | linux | arm gyp info spawn make gyp info make: Entering directory '/home/pi/nodeLibmodbus-master/build' spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] CXX(target) Release/obj.target/modbus_binding/src/main.o ../src/main.cpp:24:32: error: ‘Arguments’ does not name a type ../src/main.cpp:24:43: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] ../src/main.cpp: In function ‘v8::Handlev8::Value js_new_rtu(const int&)’: ../src/main.cpp:25:33: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:26:40: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:27:37: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:28:44: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:29:44: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:35:31: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Null(v8::Isolate*)’ /home/pi/.node-gyp/0.12.6/deps/v8/include/v8.h:306:28: note: declared here ../src/main.cpp:37:9: error: ‘Wrap’ is not a member of ‘v8::External’ ../src/main.cpp: At global scope: ../src/main.cpp:42:44: error: ‘Arguments’ does not name a type // and so on ..
I dont have a lot of experience in c++ debug but the Arguments type error seems to be the first issue.. maybe a compiler switch? Perhaps the compiler update is the issue and not V8. Thanks
Sorry, not a compiler issue this is a well known issue with Node 0.12.
Probably the best way forward is to port to use
Oops wrong button...
I am going to try and look at this so if anyone wants to help or has already started let me know
Ok it is not a compiler issue.. Seems looking at the node JS 0.12 addon page that this driver needs a substantial rewrite..
for instance I can't find an example for returning the CTX structure if based on the existing code:
Handle
So I'm thinking the biggest hurdle for me right now is to wrap the ctx object and unwrap it in the correct way using
void ####(const FunctionCallbackInfo
I was looking at https://github.com/nodejs/node-addon-examples
8_passing_wrapped/node_0.12
see https://github.com/tuxnsk/nodejs_libmodbus/commit/ecb970eb36dd6017269fd6432efb83e882ad83d6
it is a port to the new node native API
OK I am happy to see this contribution; On an PI 2 I had no issues when compiling other than the same issues I had before .. ( modbus version and response timeout which I commented out ) however on execution my node test js program I get: FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope Aborted
FYI node -v v5.4.1 npm -v 3.5.3 node-gyp -v v3.2.1
On Sat, Jan 23, 2016 at 2:56 AM, Paul Charlton notifications@github.com wrote:
see ecb970e https://github.com/tuxnsk/nodejs_libmodbus/commit/ecb970eb36dd6017269fd6432efb83e882ad83d6
it is a port to the new node native API
— Reply to this email directly or view it on GitHub https://github.com/tuxnsk/nodejs_libmodbus/issues/22#issuecomment-174171391 .
Joe Keiter C: 951-723-7167 W: 949-648-2742 H: 951-679-3050 jlkeiter@gmail.com j.keiter@controlco.com
Could it be that this awesome module is not comptabile with node v0.12.x ? I cannot compile it properly.