Search code examples
c++node.jslibrariesosx-mountain-lion

What is procedure for installing c++ libraries on OSX Mountain Lion required by NPM Module Canvas?


I am trying to install the canvas npm module, a known trouble maker! It requires three libraries: gif, jpeg, and cairo. This is basically a fresh machine. What is the best way to get these libraries available for use by npm?

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

> [email protected] 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')

Solution

  • Macports did the trick fairly painlessly