2012-08-06 129 views
0

我在OS X Lion上。我已經通過Homebrew安裝libyajl(brew install yajl)。標頭在/usr/local/include/yajl存在:Node.js:安裝node-yajl時遇到問題

scott @ scott-laptop : ~/Desktop 
$ ls /usr/local/include/yajl 
yajl_common.h yajl_gen.h  yajl_parse.h yajl_tree.h yajl_version.h 
scott @ scott-laptop : ~/Desktop 
$ node -v 
v0.8.5 
scott @ scott-laptop : ~/Desktop 
$ npm -v 
1.1.46 

但安裝節點模塊時,我得到一個錯誤:

scott @ scott-laptop : ~/Desktop 
$ npm install yajl 
npm http GET https://registry.npmjs.org/yajl 
npm http 304 https://registry.npmjs.org/yajl 

> [email protected] install /Users/scott/Desktop/node_modules/yajl 
> node-waf configure build 

Checking for program g++ or c++   : /usr/bin/g++ 
Checking for program cpp     : /usr/bin/cpp 
Checking for program ar     : /usr/bin/ar 
Checking for program ranlib    : /usr/bin/ranlib 
Checking for g++       : ok 
Checking for node path     : ok /usr/local 
Checking for node prefix     : ok /usr/local 
Checking for header yajl/yajl_version.h : not found 
/Users/scott/Desktop/node_modules/yajl/wscript:20: error: Could not find yajl headers. Make sure libyajl development package is installed. 
npm ERR! [email protected] install: `node-waf configure build` 
npm ERR! `sh "-c" "node-waf configure build"` failed with 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is most likely a problem with the yajl package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node-waf configure build 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls yajl 
npm ERR! There is likely additional logging output above. 

npm ERR! System Darwin 11.4.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "yajl" 
npm ERR! cwd /Users/scott/Desktop 
npm ERR! node -v v0.8.5 
npm ERR! npm -v 1.1.46 
npm ERR! code ELIFECYCLE 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /Users/scott/Desktop/npm-debug.log 
npm ERR! not ok code 0 

回答