NPM native builds with only Visual Studio 2013 installed
npm, visual-studio-2013
Solution
I have too clean install of Windows 8.1 (64bit) Pro with Visual Studio 2013 only (no previous version of VS, although some components came with SQL Server 2014). The `npm install` command failed with similar error.
So I tried to specify VS version
npm install --msvs_version=2013 <package>
It started correctly using Platform Toolset 'v120' but the build failed with the following error (note the `V110` used in the path for targets):
`C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(44,5): error MSB8020: The builds tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v120 to build using the v120 build tools. `
I went to the path `c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\` and found there two subfolders: `V110` and `V120`.
To correct the path used for targets I had to set environment variable like this:
set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120
Then the package got installed.
For reference, the versions: VS 2013 Premium Python 2.7.8 `C:\Windows\system32>npm version { http_parser: '1.0', node: '0.10.29', v8: '3.14.5.9', ares: '1.9.0-DEV', uv: '0.10.27', zlib: '1.2.3', modules: '11', openssl: '1.0.1h', npm: '1.4.14' }`
Problem
I've got a clean install of Windows with Visual Studio 2013 Pro installed, along with current versions of Python, node and npm. I'm trying to install the `pg` npm package, but it requires a native build and is failing: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Visual Studio 2012 (Platform Toolset = 'v110') cannot be found. To build using the v110 build tools, please install Visual Studio 2012 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right -click the solution, and then selecting "Upgrade Solution...". [C:\Users\Aaron\AppData\Roaming\npm\node_modules\pg\build\binding.vcxproj] I can't seem to find Build tools for Visual Studio 2012 as described, and I'd certainly prefer to not need to install VS2012 just for this one need. Is there a way to force the install and build to use the available 2013 compiler/tools, without changing the code of the package? I couldn't find anyone describing this specific problem and a solution using my Googlefu.