Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while installing xml2json using node.js

I tried to install xml2json package for node.js but it gives me error.

Error are as below :enter image description here

My system configuration are as below :

node.js version - v5.4.1

npm version - 3.3.12

Operating system - windows 10 64 bit

python - 2.7.11(set as environment variable )

After installing microsoft windows sdk v7.1 it gives me below error.

enter image description here

After added package.json below error is given.

enter image description here

like image 210
Keval Trivedi Avatar asked Oct 18 '22 17:10

Keval Trivedi


1 Answers

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

  1. Launch regedit Navigator to HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\WinSDKVersion
  2. 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:

  1. Launch regedit Navigator to HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\WinSDKVersion
  2. Add string key VCTargetsPath key
  3. 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.

like image 136
Andriy Ivaneyko Avatar answered Oct 21 '22 11:10

Andriy Ivaneyko