title: how to install node js canvas on windows
body: <p>I'm trying to get working canvas on node js. I'm using Windows Vista. After basic approach <code>npm install canvas</code> failed (see error below), I have looked up some tutorials, here is what I have tried:</p>
  
  <p>sources:<br>
  <a href="https://github.com/benjamind/delarre.docpad/blob/master/src/documents/posts/installing-node-canvas-for-windows.html.md" rel="noreferrer">installing-node-canvas-for-windows</a><br>
  <a href="https://github.com/LearnBoost/node-canvas/wiki/Installation---Windows" rel="noreferrer">LearnBoost/node-canvas/wiki/Installation---Windows</a></p>
  
  <ul>
  <li>I have installed older Python (2.7.5) and add it to PATH (and remove Python 3.2. from PATH)   </li>
  <li>I have checked that I do have Microsoft Visual Studio 2010 Professional installed</li>
  <li>I have downloaded the 'all in one' GTK package from <a href="http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip" rel="noreferrer">http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip</a>, unziped it in C:\GTK\ and add 'C:\GTK\bin' to PATH</li>
  </ul>
  
  <p>log in console (after running <code>npm install canvas</code> in cmd):<br>
  log contains several warnings, I don't thing these are the problem - it is mostly something like 'conversion from double to float', and one error marked in red color:</p>
  
  <pre><code>init.cc
  d:\pathToApp\node_modules\canvas\src\PNG.h(5): fatal error C1083: Cannot
  open include file: 'cairo.h': No such file or directory [d:\pathToApp\n
  ode_modules\canvas\build\canvas.vcxproj]
  </code></pre>
  
  <p>And at the very end of log there is:</p>
  
  <pre><code>gyp ERR! build error
  gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
  ` failed with exit code: 1
  gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
  npm\node_modules\node-gyp\lib\build.js:267:23)
  gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:
  12)
  gyp ERR! System Windows_NT 6.0.6002
  gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
  les\\node-gyp\\bin\\node-gyp.js" "rebuild"
  gyp ERR! cwd d:\pathToApp\node_modules\canvas
  gyp ERR! node -v v0.10.16
  gyp ERR! node-gyp -v v0.10.9
  gyp ERR! not ok
  npm ERR! weird error 1
  npm ERR! not ok code 0
  </code></pre>
  
  <p>After that, nothing appeared in node-module folder (no canvas subdirectory, npm after unsuccessful installation removed the subdirectory).</p>
  
  <p>So I have also tried to download canvas module manually from github, unzip it in node-modules and then run <code>node-gyp configure</code> in node-modules/canvas with success, and <code>node-gyp build</code>, which unfortunatelly gave me the same error <code>Cannot open include file: 'cairo.h'</code>.</p>
  
  <p>I have read everything that I found on this carefully. If you can suggest any help, please do it.</p>