【问题标题】:Node.js: Trouble installing node-yajlNode.js:安装 node-yajl 时遇到问题
【发布时间】:2012-08-06 21:16:32
【问题描述】:

我在 OS X Lion 上。我已经通过 Homebrew (brew install yajl) 安装了 libyajl。标头存在于/usr/local/include/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

但是安装 Node 模块时出现错误:

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

> yajl@0.6.1 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! yajl@0.6.1 install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the yajl@0.6.1 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

【问题讨论】:

    标签: macos node.js npm homebrew


    【解决方案1】:

    在 Node 0.8.0 中,构建系统从 node-waf 更改为 node-gyp。我在这里为 node-yajl fork 添加了一个 gyp 构建:https://github.com/scttnlsn/node-yajl

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-11
      • 2013-12-24
      • 2020-02-27
      • 2018-02-25
      • 2011-06-06
      • 2021-04-14
      • 2016-03-23
      • 2018-09-25
      相关资源
      最近更新 更多