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

Instalation error on Mac OS X Lion 10.7.4 #57

Closed
makensi opened this issue Aug 1, 2012 · 13 comments
Closed

Instalation error on Mac OS X Lion 10.7.4 #57

makensi opened this issue Aug 1, 2012 · 13 comments

Comments

@makensi
Copy link

makensi commented Aug 1, 2012

Hi there,

I want to appologize beacuse i think that it's not new topic(as I read) and I don't want to disturb anybody. I tried to install it, but seems impossible and I think that I'm doing something wrong.

Requirements Information:

  • OS Mac OS X Lion 10.7.4
  • Xcode (4.3) tools available in path: /Applications/Xcode.app/Contents/Developer/usr/bin/ (which shows information for gcc c++ and g++).
  • First I started with last 0.8.4 Node and finally i changed it to 0.6.13 as appear in README.md as last option but result was the same.

This is the stack (with node 0.6.13):

ncpro:test_server makensi$ npm install websocket
npm http GET https://registry.npmjs.org/websocket
npm http 304 https://registry.npmjs.org/websocket

> websocket@1.0.6 install /Users/makensi/Projects/workspace_node/test/test_server/node_modules/websocket
> node-gyp rebuild

info it worked if it ends with ok 
spawn python [ '/Users/makensi/.node-gyp/0.6.13/tools/gyp_addon',
  'binding.gyp',
  '-I/Users/makensi/Projects/workspace_node/test/test_server/node_modules/websocket/build/config.gypi',
  '-f',
  'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/validation/src/validation.o
make: c++: No such file or directory
make: *** [Release/obj.target/validation/src/validation.o] Error 1
ERR! Error: `make` failed with exit code: 2
    at Array.0 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:169:25)
    at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok

npm ERR! websocket@1.0.6 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the websocket@1.0.6 install script.
npm ERR! This is most likely a problem with the websocket 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 websocket
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "websocket"
npm ERR! cwd /Users/makensi/Projects/workspace_node/test/test_server
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.9
npm ERR! code ELIFECYCLE
npm ERR! message websocket@1.0.6 install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/makensi/Projects/workspace_node/test/test_server/npm-debug.log
npm not ok

If there is something else that you need, let me know it.
Thanks in advance.

@theturtle32
Copy link
Owner

I just released version 1.0.7 with a complete overhaul of the native module building process. It seems to work for me across the board. Try that and let me know how you fare.

@makensi
Copy link
Author

makensi commented Aug 14, 2012

Hi

Finally I upgrade all:

  • Node: v0.8.6
  • Xcode: v4.4.1

And I have attempted install it another time, but seems that i have same problem:

ncpro:test_server makensi$ npm install websocket --websocket:verbose 
npm WARN package.json jade@0.27.0 No README.md file found!
npm http GET https://registry.npmjs.org/websocket
npm http 304 https://registry.npmjs.org/websocket

> websocket@1.0.7 install /Users/makensi/Projects/workspace_node/test/test_server/node_modules/websocket
> node install.js

[websocket v1.0.7] Attempting to compile native extensions.
  CXX(target) Release/obj.target/validation/src/validation.o
make: c++: No such file or directory
make: *** [Release/obj.target/validation/src/validation.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:215:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Darwin 11.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/makensi/Projects/workspace_node/test/test_server/node_modules/websocket
gyp ERR! node -v v0.8.6
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok 
[websocket v1.0.7]
    Native code compile failed!!
    On Windows, native extensions require Visual Studio and Python.
    On Unix, native extensions require Python, make and a C++ compiler.
    Start npm with --websocket:verbose to show compilation output (if any).
websocket@1.0.7 node_modules/websocket

Are there extra requirements(like Windows systems) needed to compile it?

@theturtle32
Copy link
Owner

It looks like the "make" command can't find your C++ compiler. Have you compiled other software on the command line before?

I recommend installing Homebrew and compiling something small with that. I suspect once you have Homebrew working, this will work as well.

Homebrew can be found here: http://mxcl.github.com/homebrew/

However, as of version 1.0.7, WebSocket-Node will now still work even though the native module compilation failed. I added JavaScript fallback implementations. It won't be as fast, and it won't validate against receiving invalid UTF-8 data, but otherwise it will work just fine.

Brian

Sent from my iPhone

On Aug 14, 2012, at 12:35 PM, makensi notifications@github.com wrote:

Hi

Finally I upgrade all:

Node: v0.8.6
Xcode: v4.4.1
And I have attempted install it another time, but seems that i have same problem:

ncpro:test_server makensi$ npm install websocket --websocket:verbose
npm WARN package.json jade@0.27.0 No README.md file found!
npm http GET https://registry.npmjs.org/websocket
npm http 304 https://registry.npmjs.org/websocket

websocket@1.0.7 install /Users/makensi/Projects/workspace_node/test/test_server/node_modules/websocket
node install.js

[websocket v1.0.7] Attempting to compile native extensions.
CXX(target) Release/obj.target/validation/src/validation.o
make: c++: No such file or directory
make: *** [Release/obj.target/validation/src/validation.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:215:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Darwin 11.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/makensi/Projects/workspace_node/test/test_server/node_modules/websocket
gyp ERR! node -v v0.8.6
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok
[websocket v1.0.7]
Native code compile failed!!
On Windows, native extensions require Visual Studio and Python.
On Unix, native extensions require Python, make and a C++ compiler.
Start npm with --websocket:verbose to show compilation output (if any).
websocket@1.0.7 node_modules/websocket
Are there extra requirements(like Windows systems) needed to compile it?


Reply to this email directly or view it on GitHub.

@GICodeWarrior
Copy link
Contributor

This is an XCode configuration issue on your machine. Are you sure you have the command line tools installed?

@theturtle32
Copy link
Owner

Any update on this?

@theturtle32
Copy link
Owner

Closing, as I don't believe this to be an issue with WebSocket-Node.

@makensi
Copy link
Author

makensi commented Aug 20, 2012

Hi,

Sorry but i took several vacation days :P.

Finally, I found it. Seems that exists something wrong inside global node modules. After remove them (global node_modules directory) compilation was perfect.

ncpro:test_server makensi$ npm install websocket --websocket:verbose
npm http GET https://registry.npmjs.org/websocket
npm http 304 https://registry.npmjs.org/websocket

> websocket@1.0.7 install /Users/makensi/Projects/workspace_node/test/test_server/node_modules/websocket
> node install.js

[websocket v1.0.7] Attempting to compile native extensions.
gyp http GET http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished
  CXX(target) Release/obj.target/xor/src/xor.o
  SOLINK_MODULE(target) Release/xor.node
  SOLINK_MODULE(target) Release/xor.node: Finished
[websocket v1.0.7] Native extension compilation successful!
websocket@1.0.7 node_modules/websocket
ncpro:lysk_server makensi$ 

Thanks for all your help.

@stevenshu512
Copy link

hi buddy, Can you explain what is "global node_modules directory" and how to change it ? thanks a lot!

@makensi
Copy link
Author

makensi commented Sep 4, 2012

Hi,

I thought that it was related with an one update that I did on my node installation with pkg installator. I just remove all modules under:

/usr/local/lib/node_modules

And finally I have reinstalled them; mainly gyp module which was throwing errors every websocket module built.

I hope that it will be useful for you

@theturtle32
Copy link
Owner

Indeed, I have not used the pkg installer for Mac OS X and instead use nvm to install node, as I expect the vast majority of other developers do as well. This is far preferable since it allows you to switch instantly between multiple versions of node to test things.

Before using nvm, I generally used Homebrew or compiled and installed from the node.js source manually, which was also quite easy to do.

@stevenshu512
Copy link

Job done! Thanks for your adivse.
The Real thing that created this problem is that websocket make process can not find the offical node.js installation path.

so the officall nod.js install in /usr/local/lib and /usr/local/bin
But using nvm the author mentioned the path way is another. like this :

shao19@mac:~/nvm/V0.8.6/bin > ll
total 19656
-rwxr-xr-x 1 shao19 staff 10053684 9 5 11:08 node
-rwxr-xr-x 1 shao19 staff 355 8 8 02:56 node-waf
lrwxr-xr-x 1 shao19 staff 38 9 5 11:08 npm -> ../lib/node_modules/npm/bin/npm-cli.js

this is the whole different pathway that the websocket makefile can't not find the nod.js header file.so the issue appeared.
And I think we can solve this problem by writing the compatible makefile to adapt the offical installation path.

@theturtle32
Copy link
Owner

I have no idea how that could be, since the Makefile doesn't reference any paths directly at all.

https://github.com/Worlize/WebSocket-Node/blob/0a05f4ede0c2f70381ee6f0e20bcc04aefa467c0/Makefile

@theturtle32
Copy link
Owner

If there is a bug relating to paths, it's a bug in node-gyp, which is responsible for creating all the platform-specific artifacts required to do a native module compilation, not in websocket-node.

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