xmppo / node-expat

libexpat XML SAX parser binding for node.js
https://github.com/xmppo/node-expat
MIT License
385 stars 97 forks source link

Build failure on node v21.2.0 #225

Closed bnjbvr closed 1 year ago

bnjbvr commented 1 year ago

Hi! When trying to install this library with node v21.2.0, I get the following build error:

  CXX(target) Release/obj.target/node_expat/node-expat.o
In file included from ../node-expat.cc:1:
../../nan/nan.h: In function ‘bool Nan::IdleNotification(int)’:
../../nan/nan.h:686:63: warning: ‘bool v8::Isolate::IdleNotificationDeadline(double)’ is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
  686 |     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  687 |         idle_time_in_ms * 0.001);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/work/.cache/node-gyp/21.2.0/include/node/v8-initialization.h:13,
                 from /home/work/.cache/node-gyp/21.2.0/include/node/v8.h:34,
                 from /home/work/.cache/node-gyp/21.2.0/include/node/node.h:73,
                 from ../../nan/nan.h:60:
/home/work/.cache/node-gyp/21.2.0/include/node/v8-isolate.h:1341:8: note: declared here
 1341 |   bool IdleNotificationDeadline(double deadline_in_seconds);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/work/.cache/node-gyp/21.2.0/include/node/v8-array-buffer.h:12,
                 from /home/work/.cache/node-gyp/21.2.0/include/node/v8.h:24:
/home/work/.cache/node-gyp/21.2.0/include/node/v8-local-handle.h: In instantiation of ‘v8::Local<T>::Local(v8::Local<S>) [with S = v8::Data; T = v8::Value]’:
../../nan/nan_callbacks_12_inl.h:175:53:   required from here
/home/work/.cache/node-gyp/21.2.0/include/node/v8-local-handle.h:253:42: error: static assertion failed: type check
  253 |     static_assert(std::is_base_of<T, S>::value, "type check");
      |                                          ^~~~~
/home/work/.cache/node-gyp/21.2.0/include/node/v8-local-handle.h:253:42: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
make: *** [node_expat.target.mk:120: Release/obj.target/node_expat/node-expat.o] Error 1
make: Leaving directory '/home/work/code/kresus/node_modules/node-expat/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/node-gyp/lib/build.js:209:23)
gyp ERR! System Linux 6.6.1-arch1-1
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/work/code/kresus/node_modules/node-expat
gyp ERR! node -v v21.2.0
bnjbvr commented 1 year ago

Confirmed fixed by #224. Cheers :sparkles: