Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module installation fails on Mac (macOS 10.13.4) after upgrade to node v10.0.0 and npm v6.0.0 #24

Open
mailgpa opened this issue May 2, 2018 · 23 comments

Comments

@mailgpa
Copy link

mailgpa commented May 2, 2018

Module installation fails on Mac (macOS 10.13.4) after upgrade to node v10.0.0 and npm v6.0.0

$ echo $PATH
/usr/local/opt/llvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin

Manipulations with PATH (as mentioned in #2) do not help

$ npm i -g xpc-connection

> xpc-connection@0.1.4 install /usr/local/lib/node_modules/xpc-connection
> node-gyp rebuild

  CXX(target) Release/obj.target/binding/src/XpcConnection.o
../src/XpcConnection.cpp:143:89: error: too few arguments to function call, expected 2, have 1
      Local<Value> propertyValue = object->GetRealNamedProperty(propertyName->ToString());
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         ^
/Users/gpa/.node-gyp/10.0.0/include/node/v8.h:3428:3: note: 'GetRealNamedProperty' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
  ^
/Users/gpa/.node-gyp/10.0.0/include/node/v8config.h:410:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/XpcConnection.cpp:254:12: warning: 'MakeCallback' is deprecated [-Wdeprecated-declarations]
      Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
           ^
../node_modules/nan/nan.h:950:3: note: 'MakeCallback' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
  ^
../node_modules/nan/nan.h:98: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").ToLocalChecked(), 2, argv);
           ^
../node_modules/nan/nan.h:950:3: note: 'MakeCallback' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
  ^
../node_modules/nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
2 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:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/10.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/xpc-connection
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
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.
@mailgpa
Copy link
Author

mailgpa commented May 2, 2018

Changing

Local<Value> propertyValue = object->GetRealNamedProperty(propertyName->ToString());

to

Local<Value> propertyValue = Nan::GetRealNamedProperty(object->ToObject(), propertyName->ToString()).ToLocalChecked();

in src/XpcConnection.cpp helped, but not sure if this is actually the right way to fix that

@ankit2002
Copy link

Hey I am also facing the same issue... have you tried to degrade the node version back to 9 or 8?

@endquote
Copy link

endquote commented May 4, 2018

Downgrading node seems to work.

brew install node@8
brew link --overwrite --force node@8
npm install xpc-connection

(There's no node@9 in homebrew for some reason)

@ankit2002
Copy link

Thanks it doesn't work with node@8 but somehow I managed to get it with node@6..

@ceipi
Copy link

ceipi commented May 6, 2018

Got the same error with node 10.0.0/ macOS 10.13.4

@ceipi
Copy link

ceipi commented May 6, 2018

@mailgpa how did you build xpc-connection after changing line 143 in src/XpcConnection.cpp?

@mailgpa
Copy link
Author

mailgpa commented May 6, 2018

git clone https://github.com/sandeepmistry/node-xpc-connection.git
cd node-xpc-connection
vi src/XpcConnection.cpp
npm i -g

@ceipi
Copy link

ceipi commented May 6, 2018

@mailgpa: Thank you.
I was able to get one step forward but got other errors.

@ceipi
Copy link

ceipi commented May 6, 2018

Solution used : installed node.js recommended version:
Latest LTS **Version: 8.11.**1 (includes npm 5.6.0)
It seems that version 10.0.0 is not yet compatible with xlc-connection

@mailgpa mailgpa changed the title cannot install on Mac Module installation fails on Mac (macOS 10.13.4) after upgrade to node v10.0.0 and npm v6.0.0 May 6, 2018
@taoyuan
Copy link

taoyuan commented Jun 14, 2018

PR #26 upgraded to node 10

@IjzerenHein
Copy link

I can confirm that the pull request #26 by @taoyuan fixes the problem on Node 10.

To workaround the problem you can use this in your package.json

{
  "dependencies": {
    "xpc-connection": "sandeepmistry/node-xpc-connection#26/head"
  },
  "resolutions": {
    "xpc-connection": "sandeepmistry/node-xpc-connection#26/head"
  }
}

@Mo0812
Copy link

Mo0812 commented Aug 6, 2018

For me a slightly modification of @IjzerenHein snippet work:

{
  "dependencies": {
    "xpc-connection": "sandeepmistry/node-xpc-connection#pull/26/head"
  },
  "resolutions": {
    "xpc-connection": "sandeepmistry/node-xpc-connection#pull/26/head"
  }
}

@fluidof
Copy link

fluidof commented Aug 21, 2018

Where is located package.json in order to add these lines?

when I try to install xpc-connection I receive this error:
2 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:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 18.0.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 /Volumes/Utenti/Users/francescofalconi/.npm-global/lib/node_modules/xpc-connection
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.7.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!

@rgllm
Copy link

rgllm commented Aug 27, 2018

Any news on this?

@halfnhalf
Copy link

Still hitting this on 10

@robey
Copy link

robey commented Sep 12, 2018

hey, is this thing on? (taps mic) ... upgrading to node 10 seems to still break xpc-connection

@aaroexxt
Copy link

aaroexxt commented Jan 5, 2019

here's how I got it to install in the meantime: npm install git://github.com/taoyuan/node-xpc-connection.git

This circumvents this repository entirely and uses a fixed repo by @taoyuan

@elhenro
Copy link

elhenro commented Jan 8, 2019

also hit this problem on Linux and MacOs, node v10.6.0 and v10.7.0
e: node-gyp -v v3.0.3

@elhenro
Copy link

elhenro commented Jan 8, 2019

github.com/taoyuan/node-xpc-connection

when i try to install node-xpc-connection repo i get stuck at rollbackFailedOptional while installing

@blairdow
Copy link

hell yah @aaroexxt that worked for me! You're an angel

ppannuto added a commit to lab11/socitrack that referenced this issue Feb 22, 2019
Also includes a workaround for an issue to build noble on OS X
sandeepmistry/node-xpc-connection#24 (comment)
@playground
Copy link

playground commented Aug 5, 2019

Any update on this? I'm having a similar issue. Am running node v11.15.0 on MacOS MoJave 10.14.6
noble/node-bluetooth-hci-socket#112

The workaround by @taoyuan does work as a temporary solution.

@peterpoliwoda
Copy link

October on Node 10.11 still hitting this when installing a package dependent on the xpc-connection

@eugef
Copy link

eugef commented Jan 19, 2020

If you have issues using Noble with latest versions of Node.js or MacOS, you can consider using https://github.com/abandonware/noble instead!
It is a fork which is actively maintained and don't depend on node-xpc-connection

Repository owner deleted a comment from Nczemanek Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests