# Windows canvas module installation issue with npm

**URL:** <http://community.latenode.com/t/windows-canvas-module-installation-issue-with-npm/8378>\
**Category:** NPM\
**Created:** [March 24, 2025, 9:28pm UTC](http://community.latenode.com/t/windows-canvas-module-installation-issue-with-npm/8378 "2025-03-24T21:28:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hazel\_27Yoga](http://community.latenode.com/letter_avatar_proxy/v4/letter/h/c0e974/32.png) [@Hazel\_27Yoga](http://community.latenode.com/u/Hazel_27Yoga)\
**Post date:** [March 24, 2025, 9:28pm UTC](http://community.latenode.com/t/windows-canvas-module-installation-issue-with-npm/8378/1 "2025-03-24T21:28:30Z")

</div>

Hey everyone, I’m having trouble setting up the canvas module on my Windows machine. I’ve got Node.js installed, but when I try to run `npm install canvas`, I get a weird error. It says something about ‘node-waf’ not being recognized as a command or program.

Does anyone know how to fix this? I’m wondering if there’s a way to get node-waf working on Windows, or maybe there’s another method to install modules that I should be using instead?

I’ve tried searching online, but I’m still confused. Any help would be really appreciated! Thanks in advance.

---

<div class="post-metadata">

**Author:** ![SkippingLeaf](http://community.latenode.com/user_avatar/community.latenode.com/skippingleaf/32/412_2.png) [@SkippingLeaf](http://community.latenode.com/u/SkippingLeaf)\
**Post date:** [March 31, 2025, 10:20pm UTC](http://community.latenode.com/t/windows-canvas-module-installation-issue-with-npm/8378/2 "2025-03-31T22:20:31Z")

</div>

I ran into a similar issue while installing canvas on Windows. The error about ‘node-waf’ is common since Windows doesn’t include the necessary build tools by default. I solved it by first installing the Windows Build Tools using npm from an administrator command prompt. I also made sure that Python 2.7 was installed and configured by setting the Python path with npm config set python python2.7. After that, running npm install canvas worked fine. I checked my Node.js version too, to ensure compatibility with the canvas module. I hope this approach helps resolve the issue.

---

<div class="post-metadata">

**Author:** ![CreativePainter33](http://community.latenode.com/letter_avatar_proxy/v4/letter/c/258eb7/32.png) [@CreativePainter33](http://community.latenode.com/u/CreativePainter33)\
**Post date:** [March 31, 2025, 1:54pm UTC](http://community.latenode.com/t/windows-canvas-module-installation-issue-with-npm/8378/3 "2025-03-31T13:54:48Z")

</div>

I’ve dealt with this canvas installation headache on Windows before. The ‘node-waf’ error is a classic gotcha. What worked for me was using node-gyp instead. First, make sure you have Visual Studio Build Tools installed. Then, run ‘npm install -g node-gyp’ to get node-gyp globally. After that, try ‘npm install canvas’ again. If you’re still hitting snags, you might need to manually specify the version of canvas that’s compatible with your Node.js version. Something like ‘npm install canvas@2.6.1’ (adjust version as needed). It’s a bit of a process, but once you get it sorted, it’s smooth sailing from there.

---

<div class="post-metadata">

**Author:** ![Laura219](http://community.latenode.com/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@Laura219](http://community.latenode.com/u/Laura219)\
**Post date:** [March 29, 2025, 12:01am UTC](http://community.latenode.com/t/windows-canvas-module-installation-issue-with-npm/8378/4 "2025-03-29T00:01:59Z")

</div>

hey mate, had the same issue. try using node-pre-gyp instead. run ‘npm install -g node-pre-gyp’ first, then ‘npm install canvas’. worked like a charm for me. also check ur node version, might need to update. good luck!
