You have to explicitly specify the Platform Toolset when building with msbuild ( triggered by node-gyp rebuild
) . Try command below, prior running npm
:
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64
See meaning of passed arguments below, from SetEnv.cmd Usage:
/Release - Create a Release configuration build environment
/x64 - Create 64-bit x64 applications
Additional explanations
npm install xml2json
require using Windows SDK under the hood to build projects, while installing packages, with MSBuild. You have faced situation that your Windows SDK configuration isn't compatible with required by node
.
Configuring the Windows SDK Command Prompt Window section:
If you do not have Visual Studio 2010, you can use the Windows SDK Command Prompt window and the SetEnv utility to configure your application build settings.
So my suggestion is to use SetEnv utility to fix your problem ...
Other ways to fix problem
MSBuild uses VCTargetsPath property, which cannot be located because the registry lacks this key.
Check whether key exists and points to proper path
- Launch regedit Navigator to
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\WinSDKVersion
- Inspect VCTargetsPath key. The value should be "$(MSBuildExtensionsPath64)\Microsoft.Cpp\WinSDKVersion\"
if key doesn't exists or has wrong value, fix problem with steps below:
- Launch regedit Navigator to
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\WinSDKVersion
- Add string key VCTargetsPath key
- Set Value to "$(MSBuildExtensionsPath64)\Microsoft.Cpp\WinSDKVersion\"
WinSDKVersion == v4.0 (Looks like that's value of Your WinSDK Version), so replace WinSDKVersion to v4.0.