Ask coding questions

← Back to all posts
How can I install Canvas for my Discord bot?

I'm able to install other packages, but I'm only having a hard time with Canvas. Every time I try to install it, I get this error:

npm ERR! code ELIFECYCLE npm ERR! errno 126 npm ERR! [email protected] install:node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-02-17T10_30_11_809Z-debug.log`

Thanks in advance.

Answered by SixBeeps [earned 5 cycles]
View Answer

Try this:

Clean up the npm cache

Delete the node_modules folder

Reinstall the packages

If that doesn't work, then try installing an older version of Canvas.