Я столкнулся с проблемой при восстановлении зависимостей BinaryJS для Electronjs App. Я использую RaspberryPi> Raspbian> VSCode в качестве среды разработки и пакет для электронной перестройки для восстановления зависимостей. Ниже приведено подробное описание ошибки.
Примечание: чтобы воспроизвести проблему, используйте электронный быстрый запуск и установите два пакета npm 'onoff' и 'binaryjs'
Электронная перестройка найдет ровно 1 зависимость от каждого пакета, упомянутого выше, для перестройки, то есть «epoll» и «streamws» соответственно. «streamws» вызывает ниже журнала ошибок.
pi@raspberrypi:~/Documents/electron-quick-start $ ./node_modules/.bin/electron-rebuild
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@8.12.0 | linux | arm
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/pi/Documents/electron-quick-start/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 '/home/pi/Documents/electron-quick-start/node_modules/streamws/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/pi/Documents/electron-quick-start/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9',
gyp info spawn args '-Dnode_gyp_dir=/home/pi/Documents/electron-quick-start/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/<(target_arch)/iojs.lib',
gyp info spawn args '-Dmodule_root_dir=/home/pi/Documents/electron-quick-start/node_modules/streamws',
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 make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/pi/Documents/electron-quick-start/node_modules/streamws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
../src/bufferutil.cc:36:34: error: ‘Arguments’ does not name a type
static Handle<Value> New(const Arguments& args)
^~~~~~~~~
../src/bufferutil.cc:44:36: error: ‘Arguments’ does not name a type
static Handle<Value> Merge(const Arguments& args)
^~~~~~~~~
../src/bufferutil.cc:62:37: error: ‘Arguments’ does not name a type
static Handle<Value> Unmask(const Arguments& args)
^~~~~~~~~
../src/bufferutil.cc:83:35: error: ‘Arguments’ does not name a type
static Handle<Value> Mask(const Arguments& args)
^~~~~~~~~
../src/bufferutil.cc: In static member function ‘static void BufferUtil::Initialize(v8::Handle<v8::Object>)’:
../src/bufferutil.cc:25:17: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:881:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/bufferutil.cc:26:58: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
Local<FunctionTemplate> t = FunctionTemplate::New(New);
^
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:5506:34: note: candidate: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior)
static Local<FunctionTemplate> New(
^~~
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:5506:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&) {aka v8::Local<v8::Value>(const int&)}’ to ‘v8::Isolate*’
../src/bufferutil.cc:28:67: error: no matching function for call to ‘NODE_SET_METHOD(v8::Local<v8::Function>, const char [7], v8::Handle<v8::Value> (&)(const int&))’
NODE_SET_METHOD(t->GetFunction(), "unmask", BufferUtil::Unmask);
^
In file included from ../src/bufferutil.cc:8:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:264:13: note: candidate: void node::NODE_SET_METHOD(v8::Local<v8::Template>, const char*, v8::FunctionCallback) <near match>
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
^~~~~~~~~~~~~~~
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:264:13: note: conversion of argument 3 would be ill-formed:
../src/bufferutil.cc:28:67: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
NODE_SET_METHOD(t->GetFunction(), "unmask", BufferUtil::Unmask);
^
In file included from ../src/bufferutil.cc:8:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:277:13: note: candidate: void node::NODE_SET_METHOD(v8::Local<v8::Object>, const char*, v8::FunctionCallback) <near match>
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^~~~~~~~~~~~~~~
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:277:13: note: conversion of argument 3 would be ill-formed:
../src/bufferutil.cc:28:67: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
NODE_SET_METHOD(t->GetFunction(), "unmask", BufferUtil::Unmask);
^
../src/bufferutil.cc:29:63: error: no matching function for call to ‘NODE_SET_METHOD(v8::Local<v8::Function>, const char [5], v8::Handle<v8::Value> (&)(const int&))’
NODE_SET_METHOD(t->GetFunction(), "mask", BufferUtil::Mask);
^
In file included from ../src/bufferutil.cc:8:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:264:13: note: candidate: void node::NODE_SET_METHOD(v8::Local<v8::Template>, const char*, v8::FunctionCallback) <near match>
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
^~~~~~~~~~~~~~~
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:264:13: note: conversion of argument 3 would be ill-formed:
../src/bufferutil.cc:29:63: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
NODE_SET_METHOD(t->GetFunction(), "mask", BufferUtil::Mask);
^
In file included from ../src/bufferutil.cc:8:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:277:13: note: candidate: void node::NODE_SET_METHOD(v8::Local<v8::Object>, const char*, v8::FunctionCallback) <near match>
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^~~~~~~~~~~~~~~
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:277:13: note: conversion of argument 3 would be ill-formed:
../src/bufferutil.cc:29:63: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
NODE_SET_METHOD(t->GetFunction(), "mask", BufferUtil::Mask);
^
../src/bufferutil.cc:30:65: error: no matching function for call to ‘NODE_SET_METHOD(v8::Local<v8::Function>, const char [6], v8::Handle<v8::Value> (&)(const int&))’
NODE_SET_METHOD(t->GetFunction(), "merge", BufferUtil::Merge);
^
In file included from ../src/bufferutil.cc:8:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:264:13: note: candidate: void node::NODE_SET_METHOD(v8::Local<v8::Template>, const char*, v8::FunctionCallback) <near match>
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
^~~~~~~~~~~~~~~
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:264:13: note: conversion of argument 3 would be ill-formed:
../src/bufferutil.cc:30:65: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
NODE_SET_METHOD(t->GetFunction(), "merge", BufferUtil::Merge);
^
In file included from ../src/bufferutil.cc:8:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:277:13: note: candidate: void node::NODE_SET_METHOD(v8::Local<v8::Object>, const char*, v8::FunctionCallback) <near match>
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^~~~~~~~~~~~~~~
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/src/node.h:277:13: note: conversion of argument 3 would be ill-formed:
../src/bufferutil.cc:30:65: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&) {aka v8::Local<v8::Value> (*)(const int&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
NODE_SET_METHOD(t->GetFunction(), "merge", BufferUtil::Merge);
^
../src/bufferutil.cc:31:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
target->Set(String::NewSymbol("BufferUtil"), t->GetFunction());
^~~~~~
../src/bufferutil.cc: In static member function ‘static v8::Handle<v8::Value> BufferUtil::New(const int&)’:
../src/bufferutil.cc:38:17: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:881:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/bufferutil.cc:40:27: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
bufferUtil->Wrap(args.This());
^~~~
../src/bufferutil.cc:41:17: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
return args.This();
^~~~
../src/bufferutil.cc: In static member function ‘static v8::Handle<v8::Value> BufferUtil::Merge(const int&)’:
../src/bufferutil.cc:46:17: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:881:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/bufferutil.cc:47:37: error: invalid types ‘const int[int]’ for array subscript
Local<Object> bufferObj = args[0]->ToObject();
^
../src/bufferutil.cc:49:51: error: invalid types ‘const int[int]’ for array subscript
Local<Array> array = Local<Array>::Cast(args[1]);
^
../src/bufferutil.cc:59:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(True());
^~~~~
../src/bufferutil.cc:59:29: error: too few arguments to function ‘v8::Local<v8::Boolean> v8::True(v8::Isolate*)’
return scope.Close(True());
^
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:10163:16: note: declared here
Local<Boolean> True(Isolate* isolate) {
^~~~
../src/bufferutil.cc: In static member function ‘static v8::Handle<v8::Value> BufferUtil::Unmask(const int&)’:
../src/bufferutil.cc:64:17: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:881:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/bufferutil.cc:65:38: error: invalid types ‘const int[int]’ for array subscript
Local<Object> buffer_obj = args[0]->ToObject();
^
../src/bufferutil.cc:67:36: error: invalid types ‘const int[int]’ for array subscript
Local<Object> mask_obj = args[1]->ToObject();
^
../src/bufferutil.cc:80:17: error: too few arguments to function ‘v8::Local<v8::Boolean> v8::True(v8::Isolate*)’
return True();
^
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:10163:16: note: declared here
Local<Boolean> True(Isolate* isolate) {
^~~~
../src/bufferutil.cc: In static member function ‘static v8::Handle<v8::Value> BufferUtil::Mask(const int&)’:
../src/bufferutil.cc:85:17: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:881:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/bufferutil.cc:86:38: error: invalid types ‘const int[int]’ for array subscript
Local<Object> buffer_obj = args[0]->ToObject();
^
../src/bufferutil.cc:87:36: error: invalid types ‘const int[int]’ for array subscript
Local<Object> mask_obj = args[1]->ToObject();
^
../src/bufferutil.cc:89:38: error: invalid types ‘const int[int]’ for array subscript
Local<Object> output_obj = args[2]->ToObject();
^
../src/bufferutil.cc:90:37: error: invalid types ‘const int[int]’ for array subscript
unsigned int dataOffset = args[3]->Int32Value();
^
../src/bufferutil.cc:91:33: error: invalid types ‘const int[int]’ for array subscript
unsigned int length = args[4]->Int32Value();
^
../src/bufferutil.cc:105:17: error: too few arguments to function ‘v8::Local<v8::Boolean> v8::True(v8::Isolate*)’
return True();
^
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:10163:16: note: declared here
Local<Boolean> True(Isolate* isolate) {
^~~~
../src/bufferutil.cc: In function ‘void init(v8::Handle<v8::Object>)’:
../src/bufferutil.cc:111:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from ../src/bufferutil.cc:7:0:
/home/pi/.electron-gyp/.node-gyp/iojs-3.0.9/deps/v8/include/v8.h:881:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
bufferutil.target.mk:99: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/home/pi/Documents/electron-quick-start/node_modules/streamws/build'
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/Documents/electron-quick-start/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.14.71-v7+
gyp ERR! command "/usr/bin/node" "/home/pi/Documents/electron-quick-start/node_modules/.bin/node-gyp" "rebuild" "--target=3.0.9" "--arch=arm" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd /home/pi/Documents/electron-quick-start/node_modules/streamws
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
...