anvaka / ngraph.louvain.native

C++ node bindings for community detections in graphs
MIT License
7 stars 3 forks source link

Error when run npm install #1

Open vincenzopalazzo opened 4 years ago

vincenzopalazzo commented 4 years ago

Hello @anvaka,

I'm trying to install your module but I have an exception; this is the stacktrace:

/home/vincenzo/.cache/node-gyp/8.10.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/vincenzo/.cache/node-gyp/8.10.0/include/node/node_object_wrap.h:85:78:   required from here
/home/vincenzo/.cache/node-gyp/8.10.0/include/node/v8.h:9253:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vincenzo/.cache/node-gyp/8.10.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/home/vincenzo/.cache/node-gyp/8.10.0/include/node/v8.h:9253:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
louvain.target.mk:106: recipe for target 'Release/obj.target/louvain/native/v8/louvain.o' failed
make: *** [Release/obj.target/louvain/native/v8/louvain.o] Error 1
make: Leaving directory '/home/vincenzo/GitLab/hello-react/node_modules/ngraph.louvain.native/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/vincenzo/node-v12.10.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-70-generic
gyp ERR! command "/usr/bin/node" "/home/vincenzo/node-v12.10.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vincenzo/GitLab/hello-react/node_modules/ngraph.louvain.native
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 

I have looked at this issue on nodejs

anvaka commented 4 years ago

Can you test it on later version of node? I have just verified on v13, and it worked.

Node version 8 is on its depreciation path (maintenance stops at the end of 2019)...

vincenzopalazzo commented 4 years ago

Hi @anvaka,

Thanks for your help, I have updated the version node to last but I have the same error, this is the new stack trace ^

In file included from ../native/headers/louvain.h:5,
                 from ../native/v8/louvain.cc:1:
../native/headers/community-graph.h: In constructor ‘CommunityGraph::CommunityGraph(NodeId)’:
../native/headers/community-graph.h:119:46: error: exception handling disabled, use -fexceptions to enable
       throw std::out_of_range("numberOfNodes");
                                              ^
../native/v8/louvain.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Louvain::AddLink(Nan::NAN_METHOD_ARGS_TYPE)’:
../native/v8/louvain.cc:67:16: error: ‘e’ was not declared in this scope
     err.append(e.what());
                ^
In file included from /home/vincenzo/.cache/node-gyp/13.2.0/include/node/node.h:63,
                 from ../../nan/nan.h:54,
                 from ../native/headers/louvain.h:4,
                 from ../native/v8/louvain.cc:1:
/home/vincenzo/.cache/node-gyp/13.2.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/vincenzo/.cache/node-gyp/13.2.0/include/node/node_object_wrap.h:84:78:   required from here
/home/vincenzo/.cache/node-gyp/13.2.0/include/node/v8.h:10400:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vincenzo/.cache/node-gyp/13.2.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/home/vincenzo/.cache/node-gyp/13.2.0/include/node/v8.h:10400:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
louvain.target.mk:114: recipe for target 'Release/obj.target/louvain/native/v8/louvain.o' failed
make: *** [Release/obj.target/louvain/native/v8/louvain.o] Error 1
make: Leaving directory '/home/vincenzo/GitLab/hello-react/node_modules/ngraph.louvain.native/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/media/vincenzo/vincenzodev/Container/ServerApplicativo/node-v13.2.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
gyp ERR! System Linux 4.15.0-70-generic
gyp ERR! command "/media/vincenzo/vincenzodev/Container/ServerApplicativo/node-v13.2.0-linux-x64/bin/node" "/media/vincenzo/vincenzodev/Container/ServerApplicativo/node-v13.2.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vincenzo/GitLab/hello-react/node_modules/ngraph.louvain.native
gyp ERR! node -v v13.2.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN generator-react-component@0.3.1 requires a peer of yo@>=1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN material-ui-search-bar@1.0.0-beta.14 requires a peer of @material-ui/core@^1.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN material-ui-search-bar@1.0.0-beta.14 requires a peer of @material-ui/icons@^1.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-addons-test-utils@15.6.2 requires a peer of react-dom@^15.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngraph.louvain.native@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ngraph.louvain.native@1.0.0 install 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/vincenzo/.npm/_logs/2019-12-02T09_35_17_925Z-debug.log
anvaka commented 4 years ago

Based on:

exception handling disabled, use -fexceptions to enable

seems like some flags are not passed correctly to C++. What OS do you have?

Maybe it's worth playing with flags here?

vincenzopalazzo commented 4 years ago

@anvaka I'm using the linux OS, If I will find the time I can try to add the correct flag in the file.

Thanks for your help