2

我正在构建一个运行本机模块的电子应用程序。我升级到 Electron 7,但从那时起,当我使用 electron-forge 构建应用程序时出现以下错误。

我还将我的节点版本升级到 12.8.1。

为了加载本机模块,我使用了 node-ffi 的一个分支

我该如何解决?

谢谢!

An unhandled error has occurred inside Forge:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@12.8.1 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/rani/Documents/Code/Saleae/monorepo/packages/electron/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/rani/Documents/Code/Saleae/monorepo/packages/electron/node_modules/ref/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/rani/Documents/Code/Saleae/monorepo/packages/electron/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/rani/.electron-gyp/7.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/rani/.electron-gyp/7.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/rani/Documents/Code/Saleae/monorepo/packages/electron/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/rani/.electron-gyp/7.1.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/rani/Documents/Code/Saleae/monorepo/packages/electron/node_modules/ref',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/binding/src/binding.o
../src/binding.cc:222:30: error: no matching member function for call to 'BooleanValue'
  bool persistent = info[3]->BooleanValue(v8::Isolate::GetCurrent()->GetCurrentContext()).ToChecked();
                    ~~~~~~~~~^~~~~~~~~~~~
/Users/rani/.electron-gyp/7.1.0/include/node/v8.h:2653:8: note: candidate function not viable: no known conversion from 'Local<v8::Context>' to 'v8::Isolate *' for 1st argument
  bool BooleanValue(Isolate* isolate) const;
       ^
/Users/rani/.electron-gyp/7.1.0/include/node/v8.h:2662:43: note: candidate function not viable: requires 0 arguments, but 1 was provided
  V8_DEPRECATED("Use maybe version", bool BooleanValue() const);
                                          ^
../src/binding.cc:582:3: error: no matching member function for call to 'Set'
  SET_SIZEOF(int8, int8_t);
  ^~~~~~~~~~~~~~~~~~~~~~~~
../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
  smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
  ~~~~~~^~~
/Users/rani/.electron-gyp/7.1.0/include/node/v8.h:3455:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/rani/.electron-gyp/7.1.0/include/node/v8.h:3458:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/binding.cc:583:3: error: no matching member function for call to 'Set'
  SET_SIZEOF(uint8, uint8_t);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~
...
4

0 回答 0