node.js - 错误 : CAIRO_FORMAT_RGB30 was not declared in this scope

标签 node.js canvas

我正在尝试安装 node-canvas 模块,但出现以下错误: 当我执行 npm install canvas 时:

In file included from ../src/Canvas.cc:8:0:
../src/PNG.h: In function 'cairo_status_t canvas_write_png(cairo_surface_t*, png_rw_ptr,  void*)':
../src/PNG.h:139:10: error: 'CAIRO_FORMAT_RGB30' was not declared in this scope

我错过了什么?

最佳答案

这是最新版本的 node-canvas 的问题。安装旧版本(例如 1.0.4):

npm install canvas@1.0.4

关于node.js - 错误 : CAIRO_FORMAT_RGB30 was not declared in this scope,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18000762/

相关文章:

javascript - 在 Canvas 中检测鼠标与闭合贝塞尔曲线形状的碰撞

node.js - 为 restify.js 实现基于 token 的身份验证的最佳方法是什么?

javascript - 在 Chrome 中绘制文本陷阱

javascript - Fabric JS getContext ('2d' ) 与 getImageData 颜色不匹配

node.js - Socket.io 的 AS3 库

android - 你如何包装 DynamicLayout 文本?

canvas - 将对象限制在 Canvas 边界时出现问题

javascript - 使用 autoGeneratedKeyType 标识的 Breeze-Sequelize

node.js - JavaScript 模板冲突

node.js - 在nodeJS中获取SESSIONID