Package cairo was not found in the pkg-config search path. Node j.s install canvas issue

Had the same problem and @Epistemex's link helped me troubleshoot it.

... You need to install libcairo2-dev, libjpeg-dev and libgif-dev packages ...

sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev

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

Had the same problem on OS X 10.11.2 while installing qrcode package.

Solved by installing these ones:

brew install cairo
brew install pkg-config
xcode-select --install