Skip to content
Sign upLog in

How can I install Canvas for my Discord bot?

Profile icon

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.

You are viewing a single comment. View All
Profile icon

Try this:

Clean up the npm cache

npm cache clean --force

Delete the node_modules folder

rm -rf node_modules package-lock.json

Reinstall the packages

npm install

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

Profile icon

how to install an older version of canvas

Profile icon

npm i [email protected]_you_want