Skip to content

sharp and canvas cannot coexist #575

Closed

Description

@strarsis

sharp and canvas modules cannot coexist in same node process,
when requiring both, execution fails with a low level error:

var sharp  = require('sharp'),
    Canvas = require('canvas');
[...]/node_modules/sharp/build/Release/../../lib/libgio-2.0.so.0: undefined symbol: g_option_group_unref
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> ([...]/node_modules/sharp/index.js:12:13)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> ([...]/test.js:1:76)

Issue filed for canvas: Automattic/node-canvas#812

Activity

  1. papandreou commented on Sep 15, 2016

    @papandreou
    Contributor

    Duplicate of #371

  2. lovell commented on Sep 15, 2016

    @lovell
    Owner

    The tl;dr of #371 is that if you are relying on a system-wide installation of cairo for node-canvas then you should also rely on a system-wide installation of libvips for sharp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions