I am having a problem installing installing the canvas module in node..It seems to be something with cairo I am getting this error...
npm http GET https://re
Had the same problem and @Epistemex's link helped me troubleshoot it.
... You need to install
libcairo2-dev
,libjpeg-dev
andlibgif-dev
packages ...
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
When I ran into this problem the issue was that the version of pkg-config
on my path was the version supplied by chefdk instead of the homebrew installed version.
$ which pkg-config
/usr/local/bin/pkg-config
$ eval "$(chef shell-init bash)"
$ which pkg-config
/opt/chefdk/embedded/bin/pkg-config
The solution was to remove the eval "$(chef shell-init bash)"
entry from my bash profile.
More discussion of the issue in chefdk's path generation on Github https://github.com/chef/chef-dk/issues/313
The accepted answer is just fine if you use apt-get. For YUM/DNF users (Fedora, CentOS, other RHEL-like systems), use the following
yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel
I was also facing same issue on mac so I have tried these steps & I got solution
Mac OSX Version >=10.7.5 node -v = v0.8.12
$ brew install cairo
$ pkg-config --atleast-version=1.12.2 cairo
$ echo $?
If it returns a 1 you will need to set the PKG_CONFIG_PATH environment variable so cairo.pc and fontconfig.pc can be found
$ locate cairo.pc
$ export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig/
Running pkg-config again ...
$ pkg-config --atleast-version=1.12.2 cairo
$ echo $?
If it returns a 0 then all is well in the hood.
$ npm install canvas
I just needed to install pkg-config on OSX 10.10.4
brew install pkg-config
For Ubuntu, these're the commands. Also, here's the reference.
$ sudo apt-get update
$ sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev