You must explicitly specify the platform toolkit when creating with msbuild (called by node-gyp rebuild ). Try the command below before running npm :
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64
See the meaning of the arguments below: SetEnv.cmd Usage :
/ Release - create a release configuration build environment
/ x64 - Create 64-bit x64 applications
Additional explanation
npm install xml2json must use the Windows SDK under the hood to create projects when installing packages with MSBuild . You are faced with a situation where your Windows SDK configuration is not compatible with node requirements.
Setting up the Windows SDK command prompt window :
If you do not have Visual Studio 2010, you can use the Windows SDK command prompt window and SetEnv utility to configure your application build settings.
So my suggestion is to use the SetEnv utility to fix your problem ...
Other ways to fix the problem
MSBuild uses the VCTargetsPath property, which cannot be found because this registry key is missing.
Check if the key exists and points to the correct path
- Run regedit Navigator for HKLM \ SOFTWARE \ Microsoft \ MSBuild \ ToolsVersions \ WinSDKVersion
- Check the VCTargetsPath key. The value should be "$ (MSBuildExtensionsPath64) \ Microsoft.Cpp \ WinSDKVersion \"
If the key does not exist or has the wrong value, correct the problem using the steps below:
- Run regedit Navigator for HKLM \ SOFTWARE \ Microsoft \ MSBuild \ ToolsVersions \ WinSDKVersion
- Add string key VCTargetsPath .
- Set the value to "$ (MSBuildExtensionsPath64) \ Microsoft.Cpp \ WinSDKVersion \"
WinSDKVersion == v4.0 (this seems to be the value of your version of WinSDK), so replace WinSDKVersion with v4.0 .
source share