Skip to content

Installation: Prebuilt

Zach Bjornson edited this page Jul 7, 2018 · 1 revision

There's an official prebuilt NPM module that uses node-pre-gyp to download preassembled binaries so you avoid any node-gyp errors. See that repository's readme for a list of supported platforms and Node.js versions.

Install

Canvas 2.x uses prebuilds by default when you run npm install canvas or yarn add canvas. 🎉

For earlier versions, run npm install canvas-prebuilt and replace require('canvas') with require('canvas-prebuilt') in your code. You may also need to replace canvas with canvas-prebuilt in your package.json dependencies.