MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe"

Gags picture Gags · Feb 20, 2015 · Viewed 31.1k times · Source

I am trying to install nodejs from a long time now. I tried it searching over the google but seriously i had not got any working solutions.

My first question is that

  1. Why Nodejs require Microsoft Visual component?

Secondly as per suggestion on google i tried below things

  • Installed Visual C++ 2010 (updated path in the variable) but after installing i got many more errors including "MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
  • Went through https://github.com/TooTallNate/node-gyp for getting errors removed but still it is not working.
  • Uninstalled and installed Node js again but with no success.

I have following versions as

  • Node js 0.12
  • Python 2.7
  • Ruby 1.9.3
  • Windows 7 64 bit.

When i run npm-install then the error appears as below

MSBUILD : error MSB3428: Could not load the Visual C++ component 
"VCBuild.exe".To fix this, 1) install the .NET Framework 2.0 SDK, 2) 
install Microsoft Visual Studio 2005 or 3) add the location of the 
component to the system path if it is installed elsewhere. 

My package.json is as below:

{
 "name": "TRest",
 "version": "0.1.0",
 "devDependencies": {
     "grunt": "~0.4.2",
     "grunt-contrib-watch": "~0.5.3",
     "grunt-sass": "~0.11.0",
     "grunt-pixrem": "^0.1.2",
     "grunt-legacssy": "^0.2.0",
     "grunt-contrib-concat": "~0.3.0",
     "grunt-contrib-uglify": "~0.3.2",
     "node-bourbon": "^1.0.0"
  }
}

Answer

Bertus Kruger picture Bertus Kruger · May 11, 2015

You can tell npm to use Visual studio 2010 by doing this...

npm install socket.io --msvs_version=2010

Replace socket.io with the package that is giving the issue.

It is also possible to set the global settings for npm:

npm config set msvs_version 2010 --global