Skip to content

Installation: Fedora and other RPM based distributions

Zach Bjornson edited this page Jul 7, 2018 · 3 revisions

Applies to:

  • Fedora 18
  • CentOS 6
  • CentOS 7
  • Amazon Linux (2015.03 and later)
  • and other RPM-based distributions

⚠️ CentOS Users: CentOS has a very long support cycle (that is, you may be using a very old OS). CentOS 6 officially distributes a version of Cairo that is too old to build node-canvas 2.x. It also distributes GCC 4.4.7, which doesn't support C++11 as needed to build add-ons for Node.js 8.x. When you attempt to install, you will see warnings about CAIRO_FORMAT_RGB16_565 and/or CAIRO_FORMAT_INVALID or the compiler not supporting C++11. You either need to upgrade your OS, upgrade Cairo or use the prebuilt module (see Installation - Prebuilt)

Installing dependencies

$ sudo yum install gcc-c++ cairo-devel libjpeg-turbo-devel pango-devel giflib-devel

Installing node-canvas

$ npm install canvas

Fonts

As on all operating systems, you may need to install fonts.

yum search arial
yum install liberation-sans-fonts.noarch