andywer / leakage

🐛 Memory leak testing for node.
1.58k stars 52 forks source link

Package not working with NodeJS 12 #34

Open wolfy1339 opened 5 years ago

wolfy1339 commented 5 years ago

This could possibly also be due to VS 2019, but I doubt it

> @airbnb/node-memwatch@1.0.2 install C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch
> node-gyp rebuild

C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch>if not defined npm_config_node_gyp (node "C:\Users\<User>\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\<User>\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
  heapdiff.cc
  init.cc
  memwatch.cc
  util.cc
  win_delay_load_hook.cc
c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwat
ch\build\memwatch.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\memwatch.cc)
  c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\memwatch.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan_object_wrap.h(127): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwa
tch\build\memwatch.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\memwatch.cc)
  c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\memwatch.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.hh(18): error C2039: 'Handle': is not a member of 'v8' (compiling source file ..\src\memwatch.cc) [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\bui
ld\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8-profiler.h(48): note: see declaration of 'v8' (compiling source file ..\src\memwatch.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.hh(18): error C2061: syntax error: identifier 'Handle' (compiling source file ..\src\memwatch.cc) [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\bui
ld\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\memwatch.cc(19): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\me
mwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwat
ch\build\memwatch.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\heapdiff.cc)
  c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\heapdiff.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan_object_wrap.h(127): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwa
tch\build\memwatch.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\heapdiff.cc)
  c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\heapdiff.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.hh(18): error C2039: 'Handle': is not a member of 'v8' (compiling source file ..\src\heapdiff.cc) [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\bui
ld\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8-platform.h(16): note: see declaration of 'v8' (compiling source file ..\src\heapdiff.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.hh(18): error C2061: syntax error: identifier 'Handle' (compiling source file ..\src\heapdiff.cc) [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\bui
ld\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(46): error C2039: 'Handle': is not a member of 'v8' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8-platform.h(16): note: see declaration of 'v8'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(46): error C2065: 'Handle': undeclared identifier [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(46): error C2275: 'v8::Object': illegal use of this type as an expression [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]  
  c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(46): note: see declaration of 'v8::Object'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(46): error C2065: 'target': undeclared identifier [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(46): error C2761: 'void heapdiff::HeapDiff::Initialize(void)': redeclaration of member is not allowed [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwa 
tch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(47): error C2448: 'heapdiff::HeapDiff::Initialize': function-style initializer appears to be a function definition [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airb 
nb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwat
ch\build\memwatch.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\init.cc)
  c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\init.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(93): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\bui 
ld\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan_object_wrap.h(127): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwa 
tch\build\memwatch.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\init.cc)c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(93): error C2143: syntax error: missing ',' before '<'

  c:\users\<User>\desktop\programming\rest.js\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\init.cc)
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(95): error C2065: 'str': undeclared identifier [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(95): error C2512: 'v8::String::Utf8Value::Utf8Value': no appropriate default constructor available [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch
\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.hh(18): error C2039: 'Handle': is not a member of 'v8' (compiling source file ..\src\init.cc) [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\m
emwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8-profiler.h(48): note: see declaration of 'v8' (compiling source file ..\src\init.cc)c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(110): error C2664: 'std::string handleToStr
  (const int)': cannot convert argument 1 from 'v8::Local<v8::String>' to 'const int'

  c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(110): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.hh(18): error C2061: syntax error: identifier 'Handle' (compiling source file ..\src\init.cc) [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\m 
emwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(12): error C2039: 'Handle': is not a member of 'v8' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8-profiler.h(48): note: see declaration of 'v8'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(12): error C2065: 'Handle': undeclared identifier [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(12): error C2275: 'v8::Object': illegal use of this type as an expression [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(12): note: see declaration of 'v8::Object'c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(182): error C2664: 'std::string handleToStr 
  (const int)': cannot convert argument 1 from 'v8::Local<v8::String>' to 'const int'

  c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(182): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(12): error C2065: 'target': undeclared identifier [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(12): error C2182: 'init': illegal use of type 'void' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(13): error C2448: 'init': function-style initializer appears to be a function definition [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatc 
h.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\init.cc(24): warning C4312: 'type cast': conversion from 'int' to 'node::addon_register_func' of greater size [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\
build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(223): error C2143: syntax error: missing ';' before '<' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(223): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\bu 
ild\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(224): error C2143: syntax error: missing ';' before '{' [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(224): error C2447: '{': missing function header (old-style formal list?) [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(307): error C3861: 'changesetToObject': identifier not found [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(252): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(254): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(257): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(259): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(265): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(266): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(271): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(272): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(277): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(278): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(279): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(284): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\<User>\desktop\programming\rest.js\node_modules\@airbnb\node-memwatch\src\heapdiff.cc(300): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch\build\memwatch.vcxproj]
  c:\users\<User>\.node-gyp\12.2.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\<User>\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:257:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\<User>\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\<User>\Desktop\Programming\rest.js\node_modules\@airbnb\node-memwatch
gyp ERR! node -v v12.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @airbnb/node-memwatch@1.0.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @airbnb/node-memwatch@1.0.2 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!     C:\Users\<User>\AppData\Roaming\npm-cache\_logs\2019-05-25T23_11_48_315Z-debug.log
vatosarmat commented 5 years ago

Same issue on Ubuntu 18.04

brandonros commented 5 years ago

https://github.com/andywer/leakage/pull/36

Does this fix it?

andywer commented 5 years ago

Still not working with new v0.5.0. At least node 10 works now 🙄

Those native V8 bindings are a horror...

dgslv commented 5 years ago

got the same error here using node 12 =(

brandonros commented 5 years ago

Can we refactor package to use https://nodejs.org/api/v8.html#v8_v8_getheapstatistics instead of memwatch?

philkunz commented 5 years ago

@brandonros That actually makes a lot of sense!

andywer commented 5 years ago

Sorry for the late response. Yeah, that sounds like a good idea, but it will come with some effort, as memwatch also provides the heap snapshot diffing - we would have to re-implement that and make sure to garbage-collect thoroughly after diffing to not pollute the next snapshot.

I suppose that additional full GC will in turn slow down things even more 😕 Might still be worth doing it, though.

Alternative 1: We extract the C++ code for heap diffing into a package of its own and use it to heap diff without touching the heap. Even better: Let's compile it to WASM.

Alternative 2: Let's re-fork memwatch and make it use the node.js getHeapStatistics() function in newer node versions.

Edit: I did a mistake here. I was writing about v8.getHeapStatistics() while I actually meant v8.getHeapSnapshot().

brandonros commented 5 years ago

as memwatch also provides the heap snapshot diffing

Can you outline what that would look like in a require('v8').getHeapStatistics() world?

andywer commented 5 years ago

@brandonros Sorry once more for the late response – just so much to do...

I think getHeapStatistics() won't do. What we'd need to use is getHeapSnapshot() (v8 module in node 11.13+) as it comes with all the details we need to print an error message that gives you enough information to hunt down that memory leak.

We could publish a new package for heap snapshotting that uses memwatch is the local node version is < 12 and uses v8.getHeapSnapshot() in node 12+. Then we'd still need the heap diffing functionality that memwatch currently provides, but in a way (webassembly?) that it does not touch the heap.

The changes in leakage would be straight forward then:

- const diffStart = new memwatch.HeapDiff()
- // ...
- const heapdiff = diffStart.end()
+ const snapshot1 = heapSnapshotPackage.createSnapshot()
+ // ...
+ const snapshot2 = heapSnapshotPackage.createSnapshot()
+ const heapdiff = heapDiffer.diff(snapshot1, snapshot2)

I wonder if it's not significantly easier to just fork and patch memwatch once more... Any volunteers? 😅

danielmcq commented 5 years ago

How many times has memwatch been forked now? I would have thought that the airbnb fork would be better maintained, but I guess not. Their last release was in May 2018.

brandonros commented 5 years ago

node officially releasing the importable ‘v8’ library threw things off a bit, I’d imagine

sergeysova commented 4 years ago

What about to update leakage for nodejs >= 12 ?

dax006 commented 4 years ago

any fix for this?

limbosounds commented 4 years ago

Is this package dead or alive? T_T Or may be there some alternatives?

andywer commented 4 years ago

More dead than alive at the moment, tbh. We would really need a more stable solution under the hood that doesn't break with every other node.js release which is not impossible, but I hardly have the time to re-invent the low-level internals 🙄

OmgImAlexis commented 3 years ago

Sorry to bump an old issue but does anyone know any alternatives to this since this hasn't been updated in years?

andywer commented 3 years ago

Thanks for bringing this back up, @OmgImAlexis. Unfortunately, I don't have the time to update it / re-implement it for today's node.js, though. So I don't really see a short-term fix here, unless someone feels like making a major contribution or a rewrite.

OmgImAlexis commented 3 years ago

@andywer I might have a play around over the next few weeks and see if I can get something working. Not promising anything though as this gets down to a lower level than I'm familiar with.