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

Failed install on Mac #2

Closed
facultymatt opened this issue Jun 1, 2014 · 16 comments
Closed

Failed install on Mac #2

facultymatt opened this issue Jun 1, 2014 · 16 comments

Comments

@facultymatt
Copy link

Getting the following error on install

npm install xpc-connection
npm WARN package.json bluetooth@1.0.0 No description
npm WARN package.json expect.js@0.2.0 No repository field.
npm http GET https://registry.npmjs.org/xpc-connection
npm http 200 https://registry.npmjs.org/xpc-connection
npm http GET https://registry.npmjs.org/xpc-connection/-/xpc-connection-0.0.3.tgz
npm http 200 https://registry.npmjs.org/xpc-connection/-/xpc-connection-0.0.3.tgz

> xpc-connection@0.0.3 install /Users/facultymatt/Sites/labs/bluetooth/node_modules/xpc-connection
> node-gyp rebuild

make: Entering directory `/Users/facultymatt/Sites/labs/bluetooth/node_modules/xpc-connection/build'
  CXX(target) Release/obj.target/binding/src/XpcConnection.o
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:161,
                 from ../src/XpcConnection.cpp:1:
/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:16: error: expected `}' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:16: error: expected unqualified-id before '=' token
/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:17: error: expected declaration before '}' token
make: *** [Release/obj.target/binding/src/XpcConnection.o] Error 1
make: Leaving directory `/Users/facultymatt/Sites/labs/bluetooth/node_modules/xpc-connection/build'
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:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/facultymatt/Sites/labs/bluetooth/node_modules/xpc-connection
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
npm ERR! xpc-connection@0.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the xpc-connection@0.0.3 install script.
npm ERR! This is most likely a problem with the xpc-connection package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls xpc-connection
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "xpc-connection"
npm ERR! cwd /Users/facultymatt/Sites/labs/bluetooth
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/facultymatt/Sites/labs/bluetooth/npm-debug.log
npm ERR! not ok code 0

Originally reported as error at noble/noble#75 but tracked to this package.

@sandeepmistry
Copy link
Owner

Could you compare these two files:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOS 10.9.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSUserNotification.h

/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h

I don't have the second one on my Mac, I think your system is using it in the build when the first one should be used. We could verify Xcode-select is setup correctly:

xcode-select -p
xcode-select -v

the output on my Mac is:

/Applications/Xcode.app/Contents/Developer

xcode-select version 2333.

@facultymatt
Copy link
Author

OK, the two files are the same contents EXCEPT the path for my file is above and your path is below

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSUserNotification.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOS 10.9.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSUserNotification.h

This looks good

xcode-select -p
xcode-select -v
/Applications/Xcode.app/Contents/Developer
xcode-select version 2333.

@sandeepmistry
Copy link
Owner

Ok, that's the path I have as well (I accidentally replaced the X).

Hmm, might be a compiler issue then?

What's the output of gcc -v?

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.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix

@facultymatt
Copy link
Author

$ gcc -v

Using built-in specs.
Target: i686-apple-darwin12
Configured with: /opt/local/var/macports/build/_opt_mports_dports_lang_apple-gcc42/apple-gcc42/work/objroot/src/configure --disable-checking --prefix=/opt/local --mandir=/opt/local/share/man --enable-languages=c,c++,objc,obj-c++ --libexecdir=/opt/local/libexec/apple-gcc42 --libdir=/opt/local/lib/apple-gcc42 --includedir=/opt/local/include/apple-gcc42 --program-suffix=-apple-4.2 --with-system-zlib --disable-nls --with-slibdir=/usr/lib --build=x86_64-apple-darwin12 --enable-werror-always --program-prefix=i686-apple-darwin12- --host=x86_64-apple-darwin12 --target=i686-apple-darwin12 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3) (MacPorts apple-gcc42 5666.3_13)

@sandeepmistry
Copy link
Owner

Even though you have the Xcode command line tools installed, you're using the MacPort gcc.

On my Mac:

$ which gcc
/usr/bin/gcc

Try setting the path, just before npm install:

export PATH=/usr/bin:$PATH

This should switch you back to using the Apple gcc for the rest on the terminal session.

@facultymatt
Copy link
Author

Worked perfectly. Thanks for helping me through this issue.

@LeslieOA
Copy link

LeslieOA commented Jun 8, 2014

I'm still having the same problem.

which gcc is /usr/bin/gcc

Mac OS X 10.9.3

@sandeepmistry
Copy link
Owner

@LeslieOA are you sure? What's the output of gcc -v?

@LeslieOA
Copy link

Hey Sandeep.

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix

@sandeepmistry
Copy link
Owner

That's the same as mine. Is your error the exact same as Matt's first comment?

@LeslieOA
Copy link

Not exactly, but it does seem xpc-connection related.
Here's where things go south (sorry for pasting nth lines of output):

> xpc-connection@0.0.3 install /Library/WebServer/Documents/r&d/bluetooth/node-bluetooth/node_modules/noble/node_modules/xpc-connection
> node-gyp rebuild

  CXX(target) Release/obj.target/binding/src/XpcConnection.o
cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
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:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 13.2.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Library/WebServer/Documents/r&d/bluetooth/node-bluetooth/node_modules/noble/node_modules/xpc-connection
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
npm ERR! xpc-connection@0.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the xpc-connection@0.0.3 install script.
npm ERR! This is most likely a problem with the xpc-connection package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls xpc-connection
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "xpc-connection@~0.0.3"
npm ERR! cwd /Library/WebServer/Documents/r&d/bluetooth/node-bluetooth/node_modules/noble
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Library/WebServer/Documents/r&d/bluetooth/node-bluetooth/node_modules/noble/npm-debug.log
npm ERR! not ok code 0
noble install: done
npm ERR! noble@0.3.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the noble@0.3.1 install script.
npm ERR! This is most likely a problem with the noble package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls noble
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "noble" "--save"
npm ERR! cwd /Library/WebServer/Documents/r&d/bluetooth/node-bluetooth
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Library/WebServer/Documents/r&d/bluetooth/node-bluetooth/npm-debug.log
npm ERR! not ok code 0

@sandeepmistry
Copy link
Owner

Ok, it's the same as: stormboy/node-zbee#4 (comment)

What does your path look like? (echo $PATH) The default on mine is:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

@zdennis
Copy link

zdennis commented Nov 5, 2014

@sandeepmistry, your last comment about the path cleaned this up for me. My $PATH is quite abused, resetting it to yours resolved an issue I had today on Yosemite. Thank you.

@sandeepmistry
Copy link
Owner

@zdennis no problem! Do you think this should be added to the read me?

@zdennis
Copy link

zdennis commented Nov 8, 2014

@sandeepmistry, I think that would be helpful as common thing to try before filing an issue.

@sandeepmistry
Copy link
Owner

@zdennis done, see 4314027

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

4 participants