什么是在NPM Module Canvas所需的OSX Mountain Lion上安装c ++库的过程?

时间:2012-08-17 20:09:18

标签: c++ node.js libraries osx-mountain-lion

我正在尝试安装画布npm模块,一个已知的麻烦制造商!它需要三个库:gif,jpeg和cairo。这基本上是一台新机器。让这些库可供npm使用的最佳方法是什么?

$ npm install canvas
npm http GET https://registry.npmjs.org/canvas
npm http 304 https://registry.npmjs.org/canvas

> canvas@0.12.1 preinstall node_modules/canvas
> 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/lib/node 
    Checking for node prefix                 : ok /usr/local 
    Checking for library gif                 : not found 
    Checking for library jpeg                : not found 
    Checking for cairo                       : not found 
    node_modules/canvas/wscript:30: error: the configuration failed (see 'node_modules/canvas/build/config.log')

2 个答案:

答案 0 :(得分:1)

Mac homebrew可以帮助您至少部分安装这些库。我知道它可以为你安装cairo。当您尝试编译canvas时,可能必须调整一些库标志,但它可能只是开箱即用。

答案 1 :(得分:0)

Macports相当轻松地完成了这个伎俩