frida/frida-node

Build failed on Node v12

gebing opened this issue · 4 comments

frida-node build failed on Node V12, below is the make error:

make node-macos

> frida@0.0.0 install /Users/gebing/frida/frida-node
> prebuild-install || node-gyp rebuild

  CXX(target) Release/obj.target/frida_binding/src/addon.o
In file included from ../src/addon.cc:1:
In file included from ../src/application.h:4:
In file included from ../src/glib_object.h:4:
../src/runtime.h:22:41: error: no template named 'Handle' in namespace 'v8'
  v8::Local<v8::String> ValueToJson(v8::Handle<v8::Value> value);
                                    ~~~~^
../src/runtime.h:23:42: error: no template named 'Handle' in namespace 'v8'
  v8::Local<v8::Value> ValueFromJson(v8::Handle<v8::String> json);
                                     ~~~~^
../src/runtime.h:25:31: error: no template named 'Handle' in namespace 'v8'
  static bool ValueToStrv(v8::Handle<v8::Value> value, gchar*** strv,
                          ~~~~^
../src/runtime.h:29:31: error: no template named 'Handle' in namespace 'v8'
  static bool ValueToEnvp(v8::Handle<v8::Value> value, gchar*** envp,
                          ~~~~^
../src/runtime.h:33:31: error: no template named 'Handle' in namespace 'v8'
  static bool ValueToEnum(v8::Handle<v8::Value> value, GType type,
                          ~~~~^
In file included from ../src/addon.cc:1:
../src/application.h:13:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:2:
../src/child.h:12:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:3:
../src/crash.h:12:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:4:
../src/device.h:13:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:5:
../src/device_manager.h:12:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:7:
../src/icon.h:13:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:8:
../src/process.h:12:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:10:
../src/script.h:13:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:11:
../src/session.h:13:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:12:
../src/signals.h:15:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
In file included from ../src/addon.cc:13:
../src/spawn.h:12:24: error: no template named 'Handle' in namespace 'v8'
  static void Init(v8::Handle<v8::Object> exports, Runtime* runtime);
                   ~~~~^
../src/addon.cc:19:11: error: no member named 'Handle' in namespace 'v8'
using v8::Handle;
      ~~~~^
../src/addon.cc:27:13: error: variable has incomplete type 'void'
static void InitAll(Handle<Object> exports,
            ^
../src/addon.cc:27:28: error: 'Object' does not refer to a value
static void InitAll(Handle<Object> exports,
                           ^
/Users/gebing/.node-gyp/12.1.0/include/node/v8.h:3356:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [Release/obj.target/frida_binding/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/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:256:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/gebing/frida/frida-node
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frida@0.0.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frida@0.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!     /Users/gebing/.npm/_logs/2019-05-16T03_35_51_904Z-debug.log
make[1]: *** [build/frida-macos-x86_64/lib/node_modules/frida] Error 1
make: *** [node-macos] Error 2

I am using MacOSx 10.14.4, Xcode 9.4.1, Node.js 12.1.0.

I google the error and it says it is becuase Node.js v12's v8.h is incompatiable with old version.

This is the description for Node.js v12 remove v8::Handle in favor of v8::Local:
https://electronjs.org/blog/nodejs-native-addons-and-electron-5
@oleavr

Fixed in 2328c51.

@oleavr how you fixed this? I have this error today

@luismiguelbravo You definitely have a different error – you're probably just seeing output that looks similar but where the details are way different. So please read them carefully.