Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-gyp issue #36

Open
Leigh-M opened this issue Nov 23, 2021 · 3 comments
Open

node-gyp issue #36

Leigh-M opened this issue Nov 23, 2021 · 3 comments

Comments

@Leigh-M
Copy link

Leigh-M commented Nov 23, 2021

I am sure many people are running into the same issue, I was wondering what is the correct way to get around the below node-gyp issue?

Following this command: npm i libxml-xsd

npm ERR! code 1
npm ERR! path /home/leigh/projects/test-stuff/node_modules/libxmljs-mt
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/leigh/projects/test-stuff/node_modules/libxmljs-mt/build'
npm ERR!   CXX(target) Release/obj.target/xmljs/src/libxmljs.o
npm ERR! make: Leaving directory '/home/leigh/projects/test-stuff/node_modules/libxmljs-mt/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.7.8 found at "/usr/local/bin/python3"
npm ERR! gyp info spawn /usr/local/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/leigh/projects/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/leigh/projects/test-stuff/node_modules/libxmljs-mt/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/leigh/projects/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/leigh/.cache/node-gyp/14.18.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/leigh/.cache/node-gyp/14.18.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/leigh/projects/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/leigh/.cache/node-gyp/14.18.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/leigh/projects/test-stuff/node_modules/libxmljs-mt',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/libxmljs.cc:8:
npm ERR! ../src/xml_document.h:23:32: error: ‘v8::Handle’ has not been declared
npm ERR!    23 |     static void Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                                ^~~~~~
npm ERR! ../src/xml_document.h:23:38: error: expected ‘,’ or ‘...’ before ‘<’ token
npm ERR!    23 |     static void Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                                      ^
npm ERR! In file included from ../src/libxmljs.cc:9:
npm ERR! ../src/xml_node.h:32:32: error: ‘v8::Handle’ has not been declared
npm ERR!    32 |     static void Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                                ^~~~~~
npm ERR! ../src/xml_node.h:32:38: error: expected ‘,’ or ‘...’ before ‘<’ token
npm ERR!    32 |     static void Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                                      ^
npm ERR! In file included from ../src/libxmljs.cc:10:
npm ERR! ../src/xml_sax_parser.h:16:18: error: ‘v8::Handle’ has not been declared
npm ERR!    16 |   Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                  ^~~~~~
npm ERR! ../src/xml_sax_parser.h:16:24: error: expected ‘,’ or ‘...’ before ‘<’ token
npm ERR!    16 |   Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                        ^
npm ERR! In file included from ../src/libxmljs.cc:11:
npm ERR! ../src/xml_namespace.h:19:32: error: ‘v8::Handle’ has not been declared
npm ERR!    19 |     static void Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                                ^~~~~~
npm ERR! ../src/xml_namespace.h:19:38: error: expected ‘,’ or ‘...’ before ‘<’ token
npm ERR!    19 |     static void Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                                      ^
npm ERR! ../src/libxmljs.cc: In function ‘void libxmljs::adjustMem(ssize_t)’:
npm ERR! ../src/libxmljs.cc:69:17: error: ‘IsDead’ is not a member of ‘v8::V8’
npm ERR!    69 |     if (v8::V8::IsDead())
npm ERR!       |                 ^~~~~~
npm ERR! ../src/libxmljs.cc: In function ‘void libxmljs::init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’:
npm ERR! ../src/libxmljs.cc:291:31: error: cannot convert ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE’ {aka ‘v8::Local<v8::Object>’} to ‘int’
npm ERR!   291 |       XmlDocument::Initialize(target);
npm ERR!       |                               ^~~~~~
npm ERR!       |                               |
npm ERR!       |                               Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Local<v8::Object>}
npm ERR! In file included from ../src/libxmljs.cc:8:
npm ERR! ../src/xml_document.h:23:28: note:   initializing argument 1 of ‘static void libxmljs::XmlDocument::Initialize(int)’
npm ERR!    23 |     static void Initialize(v8::Handle<v8::Object> target);
npm ERR!       |                            ^~~~~~~~~~
npm ERR! ../src/libxmljs.cc:292:32: error: cannot convert ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE’ {aka ‘v8::Local<v8::Object>’} to ‘int’
npm ERR!   292 |       XmlSaxParser::Initialize(target);
npm ERR!       |                                ^~~~~~
npm ERR!       |                                |
npm ERR!       |                                Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Local<v8::Object>}
npm ERR! In file included from ../src/libxmljs.cc:10:
npm ERR! ../src/xml_sax_parser.h:16:14: note:   initializing argument 1 of ‘static void libxmljs::XmlSaxParser::Initialize(int)’
npm ERR!    16 |   Initialize(v8::Handle<v8::Object> target);
npm ERR!       |              ^~~~~~~~~~
npm ERR! In file included from ../src/libxmljs.h:6,
npm ERR!                  from ../src/libxmljs.cc:7:
npm ERR! ../src/libxmljs.cc: At global scope:
npm ERR! /home/leigh/.cache/node-gyp/14.18.1/include/node/node.h:787:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR!   787 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/leigh/.cache/node-gyp/14.18.1/include/node/node.h:821:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR!   821 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/libxmljs.cc:312:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR!   312 | NODE_MODULE(xmljs, init)
npm ERR!       | ^~~~~~~~~~~
npm ERR! In file included from ../src/libxmljs.cc:3:
npm ERR! /home/leigh/.cache/node-gyp/14.18.1/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>&)]’:
npm ERR! /home/leigh/.cache/node-gyp/14.18.1/include/node/node_object_wrap.h:85:78:   required from here
npm ERR! /home/leigh/.cache/node-gyp/14.18.1/include/node/v8.h:10886: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]
npm ERR! 10886 |                reinterpret_cast<Callback>(callback), type);
npm ERR!       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/leigh/.cache/node-gyp/14.18.1/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>&)]’:
npm ERR! ../../nan/nan_object_wrap.h:65:61:   required from here
npm ERR! /home/leigh/.cache/node-gyp/14.18.1/include/node/v8.h:10886: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]
npm ERR! make: *** [xmljs.target.mk:178: Release/obj.target/xmljs/src/libxmljs.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/leigh/projects/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
npm ERR! gyp ERR! System Linux 5.13.1-051301-generic
npm ERR! gyp ERR! command "/home/leigh/.nvm/versions/node/v14.18.1/bin/node" "/home/leigh/projects/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/leigh/projects/test-stuff/node_modules/libxmljs-mt
npm ERR! gyp ERR! node -v v14.18.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/leigh/.npm/_logs/2021-11-23T16_07_07_675Z-debug.log

Thanks in advance for any help - much appreciated! (I can make a donation when resolved this is niggling!)

@johan-daniel
Copy link

have you managed to bypass the error? i've been stuck on it for the entire afternoon too

@jasonperrone
Copy link

@Leigh-M anything become of this?

@Leigh-M
Copy link
Author

Leigh-M commented Sep 6, 2023

Apologies I haven't needed to use that module for a couple of years or so. node14 end of life now I imagine you've tried a full node 16 or 18 reinstall to see if it avoids the issue (not strictly solve it!) but if not that would be next on my list to try! Good luck pls do update if you manage to resolve/ work around it

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

No branches or pull requests

3 participants