在 MacOS 上安装 XPC 连接时出错。目前正在运行 Mojave (10.14.6)。对于上下文,我正在使用这个 repo破解一个furby 。它让我运行 npm install
,然后npm install xpc-connection
进行设置。当我运行时,npm install xpc-connection
我收到以下错误:
npm ERR! path /Users/lornythegreat/Documents/code/furby/bluefluff/fluffd/node_modules/xpc-connection
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! CXX(target) Release/obj.target/binding/src/XpcConnection.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@16.13.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.7.6 found at "/Users/lornythegreat/anaconda3/bin/python3"
npm ERR! gyp info spawn /Users/lornythegreat/anaconda3/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/lornythegreat/Documents/code/furby/bluefluff/fluffd/node_modules/xpc-connection/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/lornythegreat/Library/Caches/node-gyp/16.13.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/lornythegreat/Library/Caches/node-gyp/16.13.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/lornythegreat/Documents/code/furby/bluefluff/fluffd/node_modules/xpc-connection',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/XpcConnection.cpp:26:77: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! target->Set(Nan::New("XpcConnection").ToLocalChecked(), tmpl->GetFunction());
npm ERR! ~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:6802:3: note: 'GetFunction' declared here
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8config.h:491:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
npm ERR! #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:103:54: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! xpcObject = xpc_int64_create(value->IntegerValue());
npm ERR! ~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3101:3: note: 'IntegerValue' declared here
npm ERR! V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8config.h:491:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
npm ERR! #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:113:49: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! Local<Object> valueObject = value->ToObject();
npm ERR! ~~~~~~~~~~~~~~~ ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3060:3: note: 'ToObject' declared here
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8config.h:491:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
npm ERR! #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:115:78: error: too few arguments to function call, expected 2, have 1
npm ERR! if (valueObject->HasRealNamedProperty(Nan::New("isUuid").ToLocalChecked())) {
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:4250:3: note: 'HasRealNamedProperty' declared here
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedProperty(Local<Context> context,
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8config.h:491:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
npm ERR! #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:123:49: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! Local<Object> valueObject = value->ToObject();
npm ERR! ~~~~~~~~~~~~~~~ ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3060:3: note: 'ToObject' declared here
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8config.h:491:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
npm ERR! #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:135:40: error: no matching member function for call to 'GetPropertyNames'
npm ERR! Local<Array> propertyNames = object->GetPropertyNames();
npm ERR! ~~~~~~~~^~~~~~~~~~~~~~~~
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:4115:43: note: candidate function not viable: requires single argument 'context', but no arguments were provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetPropertyNames(
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:4117:43: note: candidate function not viable: requires at least 4 arguments, but 0 were provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetPropertyNames(
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:138:48: error: no matching member function for call to 'Get'
npm ERR! Local<Value> propertyName = propertyNames->Get(i);
npm ERR! ~~~~~~~~~~~~~~~^~~
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:4007:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:4010:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:143:88: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! Local<Value> propertyValue = object->GetRealNamedProperty(propertyName->ToString());
npm ERR! ~~~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3048:3: note: 'ToString' declared here
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8config.h:491:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
npm ERR! #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:160:33: error: no matching member function for call to 'Get'
npm ERR! Local<Value> value = array->Get(i);
npm ERR! ~~~~~~~^~~
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:4007:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:4010:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:200:13: error: no matching member function for call to 'Set'
npm ERR! object->Set(Nan::New<String>(key).ToLocalChecked(), XpcConnection::XpcObjectToValue(value));
npm ERR! ~~~~~~~~^~~
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:212:12: error: no matching member function for call to 'Set'
npm ERR! array->Set(Nan::New<Number>(index), XpcConnection::XpcObjectToValue(value));
npm ERR! ~~~~~~~^~~
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! ^
npm ERR! /Users/lornythegreat/Library/Caches/node-gyp/16.13.0/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:254:12: warning: 'MakeCallback' is deprecated [-Wdeprecated-declarations]
npm ERR! Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
npm ERR! ^
npm ERR! ../../nan/nan.h:1049:3: note: 'MakeCallback' has been explicitly marked deprecated here
npm ERR! NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
npm ERR! ^
npm ERR! ../../nan/nan.h:108:40: note: expanded from macro 'NAN_DEPRECATED'
npm ERR! # define NAN_DEPRECATED __attribute__((deprecated))
npm ERR! ^
npm ERR! ../src/XpcConnection.cpp:263:12: warning: 'MakeCallback' is deprecated [-Wdeprecated-declarations]
npm ERR! Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
npm ERR! ^
npm ERR! ../../nan/nan.h:1049:3: note: 'MakeCallback' has been explicitly marked deprecated here
npm ERR! NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
npm ERR! ^
npm ERR! ../../nan/nan.h:108:40: note: expanded from macro 'NAN_DEPRECATED'
npm ERR! # define NAN_DEPRECATED __attribute__((deprecated))
npm ERR! ^
npm ERR! 2 warnings and 11 errors generated.
npm ERR! make: *** [Release/obj.target/binding/src/XpcConnection.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 18.7.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/lornythegreat/Documents/code/furby/bluefluff/fluffd/node_modules/xpc-connection
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v8.2.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
有谁知道如何解决这个问题?我搜索了其他论坛,但找不到mac的解决方案。我想知道这是否也是 node.js 版本的问题。我目前正在运行 node.js 的 v16.13.0。谢谢。