I’m having trouble installing the canvas module on my Windows machine with Node.js. When I run npm install canvas
, I get an error about node-waf
not being recognized. Does anyone know how to fix this?
Here’s what I’ve tried:
C:\Users\Me> npm install canvas
'node-waf' is not recognized as an internal or external command, operable program or batch file.
Is there a way to get node-waf working on Windows? Or maybe another method to install canvas? I’m pretty new to Node.js, so any help would be great. Thanks!
hey Oscar64, i ran into this issue too. node-waf is outdated, try using node-gyp instead. Make sure you have python and Visual Studio Build Tools installed. then run npm install --global --production windows-build-tools
before trying to install canvas again. good luck!
I encountered a similar problem when setting up canvas on Windows. The node-waf error is indeed frustrating. Here’s what worked for me: First, ensure you have the latest Node.js version installed. Then, install the Windows-specific dependencies by running ‘npm install --global --production windows-build-tools’ in an admin PowerShell. After that, try ‘npm install canvas’ again. If you still face issues, consider using a pre-built binary. You can find these on the node-canvas GitHub page under ‘Prebuilt binaries’. Download the appropriate version for your Node.js and Windows setup, then place it in your project’s node_modules folder. This approach saved me hours of troubleshooting.