Mac 10.7.4, node 0.8.8 npm install fails
Any ideas why npm install soap is failing here?
.....
[email protected] install /Users/rich/dev/daisy/daisyjs-platform/node_modules/soap/node_modules/node-expat node-gyp rebuild
CXX(target) Release/obj.target/node_expat/node-expat.o
SOLINK_MODULE(target) Release/node_expat.node
ld: warning: ignoring file Release/obj.target/node_expat/node-expat.o, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 1 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): Release/obj.target/node_expat/node-expat.o
llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory
clang: error: linker (via gcc) command failed with exit code 255 (use -v to see invocation)
make: *** [Release/node_expat.node] Error 255
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:219:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Darwin 11.4.2
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/rich/dev/daisy/daisyjs-platform/node_modules/soap/node_modules/node-expat
Make sure to install macports (from macports.org) and run sudo port install expat
Hi,
could you please briefly explain what the problem actually is and why I do have to use macports?
Thanks, Ralph
Sure. Some packages managed by npm have OS dependencies. In the case of node-expat, this dependency is on the availability of libexpat.a. NPM (unfortunately) does not manage OS dependencies, because there is no uniform way to do that. As a result, one has to use the "native" package management system to install these dependencies manually. If you look at https://github.com/astro/node-expat, they actually tell you to run apt-get install libexpat1-dev.
Macports is the closest OSX-equivalent to apt-get on Ubuntu or yum on CentOS/Redhat.
My $0.02 cents is that this is one of the thorniest issues when working with Node/NPM and I hope that NPM will take on the provisioning problem on the OS soon... But for now...
Ok ... thought of something like that, but really wasn't sure. Thanks for the explanation since I'm currently starting a deep dive into node ...
Seems like it's not just Windows that requires you to go to trouble to get node-gyp to work. I have created a fork that replaces Expat with Sax: https://github.com/milewise/node-soap/issues/206
Closed as this issue refers to an outdated dependency (dropped node-expat in favour of sax --> #246)