Installing node-canvas

When faced with this error when installing node-canvas

Package xcb-shm was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-shm.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcb-shm', required by 'cairo', not found

export pkg-config

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

And, then try npm install again