Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support NodeJS 4.x - Upgrade Canvas #556

Closed
wants to merge 1 commit into from
Closed

Conversation

ekristen
Copy link

@ekristen ekristen commented Nov 3, 2015

Updating Canvas to 1.3.0 allows this to build under NodeJS 4.x

@espadrine
Copy link
Member

Good good good! Thanks a lot.

It doesn't work with node 5, though, I think. I get Module version mismatch. Expected 47, got 14. Maybe we can skip 4 and use 5?

@ekristen
Copy link
Author

ekristen commented Nov 4, 2015

4 is LTS. Probably need to rm rf your node_modules folder and reinstall all modules, that should fix the module error you saw.

Sent from my iPhone

On Nov 4, 2015, at 02:53, Thaddee Tyl [email protected] wrote:

Good good good! Thanks a lot.

It doesn't work with node 5, though, I think. I get Module version mismatch. Expected 47, got 14. Maybe we can skip 4 and use 5?


Reply to this email directly or view it on GitHub.

@espadrine
Copy link
Member

There is a significant change to the way canvases compute size; do you know if font loading changed?

Edit: looks like I studied it a bit a while ago: #458.

TL;DR: this commit broke node-canvas Automattic/node-canvas@7522aca, and this patch Automattic/node-canvas#543 fixes it, but nobody reviewed it, and one of the maintainers suggests this patch Automattic/node-canvas#628 which simply reverts the issue.

One option is to switch to pdfkit: #496, which looks more and more like the way out.

@LinusU
Copy link

LinusU commented Nov 16, 2015

Module version mismatch. Expected 47, got 14

This error is because the module that is being loaded was compiled for an older version of Node.js than is running. It can be fixed with npm rebuild.

Automattic/node-canvas#543 fixes it, but nobody reviewed it

I'm sorry that this haven't been properly reviewed yet. I posted a comment there and I'll be happy to test it once it's been rebased on master.

Re. the path, I would recommend using ^1.3.0 instead of ~1.3.0. That way you'll receive all backwards-compatible releases, and not just bugfix releases. This goes for all of your dependencies.

I'll be happy to help you get this working with the latest version of canvas 👍

@yannickglt
Copy link

+1

@yannickglt
Copy link

@ekristen The build of the docker image fails with the version 1.3.0 of the lib canvas. You may need to update the Dockerfile as it is based on the image node:0.12.7.

@ekristen
Copy link
Author

I'll take a look.

@paulmelnikow
Copy link
Member

Made obsolete by #496, which switched from canvas to pdfkit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants