Ask coding questions

← Back to all posts
npm package canvas not working
h
Theix (0)

As the title says I'm trying to use the canvas package. But when I run the code It gives me this:

I expected it was because the canvas package was newer, and because replit uses an older version node.js it doesn't work. I somehow fixed this isue once, and got it to work, but I have no idea what I did, and cannot get it to work now. I know [email protected] should match the version of node replit uses. Any help is much appreciated

Voters
Theix (0)
Comments
hotnewtop
Theix (0)

Nvm I fixed it by using yarn to install [email protected] and just updated the package.json to say "canvas": "^2.8.0". And now it works