qrohlf / trianglify

Algorithmically generated triangle art
http://qrohlf.com/trianglify/
GNU General Public License v3.0
10.08k stars 669 forks source link

Fixed: TypeError: Cannot read property 'canvas' of undefined #100

Closed xaionaro closed 5 years ago

xaionaro commented 5 years ago

The error occured on NodeJS8 on MacOS Mojave with canvas2.0

qrohlf commented 5 years ago

I’m not sure how you got a node-canvas 2.x dependency in your stack, since the package.json explicitly wants node-canvas 1.x?

stevewillard commented 5 years ago

I'm seeing the same issue on Node 11.9 on Mojave

qrohlf commented 5 years ago

@stevewillard can you verify that you've got a compatible (1.x) version of node-canvas installed?

stevewillard commented 5 years ago

Ah, I realized that I had a canvas version 2.x.x in the dependencies for some reason. I removed it and it works now! Thanks.

xaionaro commented 5 years ago

OK. I close this because there's no time to refresh in memory why did I need canvas 2.x.

At least other people can see this ticket and understand this problem now (if they meet it).

qrohlf commented 5 years ago

I’ll add support for 2.x and probably just drop support for 1.x in the next major version of Trianglify, this PR is going to be useful as a reference. Thanks for taking the time!