title: How to get Node-gyp working on Windows 10
body: <p>I'm just learning nodejs on windows.  It seems that the node-gyp package is incredibly painful to set up.  I've tried many guides online but I feel like I am playing a guessing game. The windows version is quite fresh, only a week or so old.</p>
  <p>The official page (<a href="https://github.com/nodejs/node-gyp" rel="nofollow noreferrer">https://github.com/nodejs/node-gyp</a>) says:</p>
  <p>(trying to take the least complicated path)</p>
  <blockquote>
  <pre><code>npm install -g node-gyp
  
  npm install --global --production windows-build-tools
  </code></pre>
  <p>If the above didn't work&quot; go to <a href="https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules" rel="nofollow noreferrer">https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules</a></p>
  </blockquote>
  <hr/>
  <p>If I just run <strong>node-gyp</strong>, I get</p>
  <pre><code>Cannot find module: 'C:\Program Files\nodejs\node_modules\npm\node_modules\node_modules\node-gyp\bin\node-gyp.js' ( etc ).
  </code></pre>
  <p>Even though that file exists.</p>
  <p>I've even tried uninstalling node, clearing out <code>%appdata%</code> cache, etc, and removing other things.</p>
  <hr/>
  <p>If I try to install something dependent on node-gyp, I get:</p>
  <pre><code>..\src\ursaNative.cc(157): warning C4244: ( etc ) .. 
  
  ERR! stack Error: `msbuild` 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:258:23)
  </code></pre>
  <hr/>
  <p>I have spent many, many hours on this - I cannot believe how painful this is.</p>
  <p>I have</p>
  <ul>
  <li>Installed the VS Tools (as above)</li>
  <li>Installed the C++ Compiler</li>
  <li>installed Build tools <a href="https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&amp;rel=15" rel="nofollow noreferrer">https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&amp;rel=15</a></li>
  <li>Tried setting the environment to VS2015 (and VS 2017)</li>
  <li>tried to follow many stack overflow fixes and posts. Surely there is a sure path to get this going.</li>
  <li>Various combinations of uninstalling / re-installing locally and globally.</li>
  </ul>
  <p>Any ideas on where to go from here?</p>