问题描述
我在Mac OS X 10.9.3上构建libxmljs时遇到问题.
I'm having a problems building libxmljs on my mac os x 10.9.3.
这就是我要得到的:
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 [email protected]
npm ERR! weird error 1
npm ERR! not ok code 0
所以...这是一个奇怪的错误1.无法真正弄清楚到底是什么.
So... It's some wierd error 1. Can't really figure out what exactly.
安装了自制软件的节点.
The node installed with homebrew.
推荐答案
好的.这是交易.构建用于自制安装的node.js的模块存在描述的问题.
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
当您使用自制软件的libtool时会发生这种情况.您应该使用/usr/bin/libtool 中的系统范围.
This happenes when you're using homebrew's libtool. You should use systemwide that's located in /usr/bin/libtool.
要解决此问题,您可以键入哪个libtool .如果它在/usr/local/Cellar/libtool .... 中,则它是自制软件.只需使用以下命令将其取消链接:
To fix this issue you can type which libtool.If it is in /usr/local/Cellar/libtool.... then it's homebrew's one. Just unlink it with this command:
brew unlink libtool
安装npm并再次将其链接回
Do your npm install and link it back again
brew link libtool
在我的情况下,我在MAMP中安装了libtool.因此,我编辑了〜/.bash_profile 文件,并删除了 PATH ="/Applications/MAMP/Library/bin:$ {PATH}" 行,我最近添加了自己的文件
In my case i had libtool installed with MAMP.So I edited my ~/.bash_profile file and removed that PATH="/Applications/MAMP/Library/bin:${PATH}" line i recently added my my own.
这篇关于为node.js构建libxmljs时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!