sandeepmistry / node-xpc-connection

MIT License
35 stars 29 forks source link

xpc-connection refuses to install #30

Open MetromapSVG opened 5 years ago

MetromapSVG commented 5 years ago

Hello.

I have attempted to install xpc connection but my Mac refuses to install it. I have changed the directory, followed instructions in issue #2 with nothing changed.

Below is what I have.

$ xcode-select -p /Applications/Xcode.app/Contents/Developer

$ xcode-select -v xcode-select version 2354.

$ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.1 (clang-1001.0.46.3) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ which gcc /usr/bin/gcc

$ sudo npm i -g xpc-connection

xpc-connection@0.1.4 install /Users/ernest/.npm-global/lib/node_modules/xpc-connection node-gyp rebuild

gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/ernest/.npm-global/lib/node_modules/xpc-connection/build' gyp ERR! System Darwin 18.2.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/ernest/.npm-global/lib/node_modules/xpc-connection gyp ERR! node -v v11.13.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! xpc-connection@0.1.4 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the xpc-connection@0.1.4 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/ernest/.npm/_logs/2019-04-01T13_20_38_392Z-debug.log

piersbarrios commented 5 years ago

Try: sudo npm i -g xpc-connection --unsafe-perm

MetromapSVG commented 5 years ago

Still has errors even with the --unsafe-perm syntax:

`> xpc-connection@0.1.4 install /Users/ernest/.npm-global/lib/node_modules/xpc-connection
> node-gyp rebuild

  CXX(target) Release/obj.target/binding/src/XpcConnection.o
../src/XpcConnection.cpp:103:41: warning: 'IntegerValue' is deprecated: Use
      maybe version [-Wdeprecated-declarations]
    xpcObject = xpc_int64_create(value->IntegerValue());
                                        ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8.h:2570:3: note: 'IntegerValue'
      has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
  ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8config.h:326:29: note: expanded
      from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/XpcConnection.cpp:113:40: warning: 'ToObject' is deprecated: Use maybe
      version [-Wdeprecated-declarations]
    Local<Object> valueObject = value->ToObject();
                                       ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8.h:2549:10: note: 'ToObject' has
      been explicitly marked deprecated here
  inline V8_DEPRECATED("Use maybe version", Local<Object> ToObject() const);
         ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8config.h:326:29: note: expanded
      from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/XpcConnection.cpp:123:40: warning: 'ToObject' is deprecated: Use maybe
      version [-Wdeprecated-declarations]
    Local<Object> valueObject = value->ToObject();
                                       ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8.h:2549:10: note: 'ToObject' has
      been explicitly marked deprecated here
  inline V8_DEPRECATED("Use maybe version", Local<Object> ToObject() const);
         ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8config.h:326:29: note: expanded
      from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/XpcConnection.cpp:143:89: error: too few arguments to function call,
      expected 2, have 1
  ...propertyValue = object->GetRealNamedProperty(propertyName->ToString());
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8.h:3668:3: note: 
      'GetRealNamedProperty' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
  ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8config.h:418:31: note: expanded
      from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/XpcConnection.cpp:143:79: warning: 'ToString' is deprecated: Use maybe
      version [-Wdeprecated-declarations]
  ...propertyValue = object->GetRealNamedProperty(propertyName->ToString());
                                                                ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8.h:2548:10: note: 'ToString' has
      been explicitly marked deprecated here
  inline V8_DEPRECATED("Use maybe version", Local<String> ToString() const);
         ^
/Users/ernest/.node-gyp/11.13.0/include/node/v8config.h:326:29: note: expanded
      from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/XpcConnection.cpp:254:12: warning: 'MakeCallback' is deprecated
      [-Wdeprecated-declarations]
      Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").T...
           ^
../node_modules/nan/nan.h:980:3: note: 'MakeCallback' has been explicitly marked
      deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
  ^
../node_modules/nan/nan.h:103:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/XpcConnection.cpp:263:12: warning: 'MakeCallback' is deprecated
      [-Wdeprecated-declarations]
      Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").T...
           ^
../node_modules/nan/nan.h:980:3: note: 'MakeCallback' has been explicitly marked
      deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
  ^
../node_modules/nan/nan.h:103:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
6 warnings and 1 error generated.
make: *** [Release/obj.target/binding/src/XpcConnection.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:193:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:255:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ernest/.npm-global/lib/node_modules/xpc-connection
gyp ERR! node -v v11.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xpc-connection@0.1.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the xpc-connection@0.1.4 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/ernest/.npm/_logs/2019-04-02T12_00_22_411Z-debug.log`
a-x- commented 5 years ago

Still have an issue

Screenshot 2019-04-27 at 14 29 28

                         ^
../src/XpcConnection.cpp:143:89: error: too few arguments to function call, expected 2, have 1
      Local<Value> propertyValue = object->GetRealNamedProperty(propertyName->ToString());
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         ^

...

6 warnings and 1 error generated.
make: *** [Release/obj.target/binding/src/XpcConnection.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:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/Users/mxtnr/n/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mxtnr/xp/xiaomi-mi-band-2-heart-rate/miband-js-app/node_modules/xpc-connection
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN miband-js-app@1.0.0 No description
npm WARN miband-js-app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bluetooth-hci-socket@0.5.1 (node_modules/bluetooth-hci-socket):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for bluetooth-hci-socket@0.5.1: wanted {"os":"linux,android,win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@0.1.4 (node_modules/xpc-connection):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@0.1.4 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ miband@0.1.4
added 17 packages from 12 contributors and audited 143 packages in 4.045s
found 2 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

xp/xiaomi-mi-band-2-heart-rate/miband-js-app took 5s ❯ miband-test        
internal/modules/cjs/loader.js:651
    throw err;
    ^

Error: Cannot find module 'xpc-connection'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
    at Function.Module._load (internal/modules/cjs/loader.js:575:25)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/Users/mxtnr/xp/xiaomi-mi-band-2-heart-rate/miband-js-app/node_modules/noble/lib/mac/highsierra.js:7:21)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)

https://github.com/vshymanskyy/miband-js/issues/26

a-x- commented 5 years ago

CXXFLAGS="-mmacosx-version-min=10.14" LDFLAGS="-mmacosx-version-min=10.14" npm add xpc-connection didn't help too.

a-x- commented 5 years ago

GetRealNamedProperty actually have 2 args: Local context, Local key

https://github.com/v8/v8/blob/381a7f9/include/v8.h#L3653

a-x- commented 5 years ago

how to understand for what the Local context arg added?

mindhells commented 5 years ago

worked with node 8 for me

st4rrk commented 5 years ago

Same issue here, nothing above helped, had some news? node --version == v10.16.0 npm --version == 6.9.0 macOS version == 10.14.5

jonattanva commented 4 years ago

some news?

qbalsdon commented 3 years ago

Also having this issue

johnwojo commented 2 years ago

Same issue as above.

nick-craffey commented 1 year ago

Still having this issue in 2023.