Node-gyp cannot find msbuild.exe

Hello I am on the processes of creating a native node module on windows, but whenever I ran the node-gyp build binding.gyp command I obtain an error that states "error: Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008 installed?". I have Visual Studio 2013 installed and the msbuild directory is C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe. I tried adding that to the PATH variable, and I am able to start a cmd prompt and run msbuild.exe and it will return the version so that seems to be working, but for some reason node-gyp cannot detect it, I even attempted to modify the build.js file within node-gyp to have it point to the msbuild location but it fails.

You can download just the build tools

Microsoft Build Tools 2013 : http://www.microsoft.com/en-us/download/details.aspx?id=40760

run cmd to set global flag to use the 2013 version:

npm config set msvs_version 2013 --global

after this everything should be back to normal and your npm install / node-gyp rebuild will work