Error building libxmljs for node.js

I'm having a problems building libxmljs on my mac os x 10.9.3.

Here's what I'm getting:

3 warnings generated. CC(target) Release/obj.target/libxml/vendor/libxml/xpointer.o LIBTOOL-STATIC Release/xml.a libtool: unrecognized option `-static' libtool: Try `libtool --help' for more information. make: *** [Release/xml.a] 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:789: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 /usr/local/lib/node_modules/libxmljs gyp ERR! node -v v0.10.13 gyp ERR! node-gyp -v v0.10.2 gyp ERR! not ok unbuild libxmljs@0.10.0 npm ERR! weird error 1 npm ERR! not ok code 0

So... It's some wierd error 1. Can't really figure out what exactly.

The node installed with homebrew.

Answer1:

Okay. Here's the deal. There's a described problem with building modules for homebrew installed node.js.

libtool: unrecognized option `-static'

http://flummox-engineering.blogspot.ru/2014/04/libtool-unrecognized-option-static.html

This happenes when you're using homebrew's libtool. You should use systemwide that's located in <strong>/usr/bin/libtool</strong>.

To fix this issue you can type <strong>which libtool</strong>. If it is in <strong>/usr/local/Cellar/libtool....</strong> then it's homebrew's one. Just unlink it with this command:

brew unlink libtool

Do your npm install and link it back again

brew link libtool

In my case i had libtool installed with MAMP. So I edited my <strong>~/.bash_profile</strong> file and removed that <strong>PATH="/Applications/MAMP/Library/bin:${PATH}"</strong> line i recently added my my own.

人吐槽 人点赞

Recommend

Comment

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:Error building libxmljs for node.js