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

37,115

Solution 1

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

Solution 2

alternatively try npm install --global --production windows-build-tools

Solution 3

Use the PowerShell with administrative rights and run:

npm install --global --production [email protected]

after that it will work smoothly.

Solution 4

I was trying to install strongloop and got this error "MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe”. I was able to resolve by running this.

find node on your windows with $ npm install -g which $ which node after cd into the directory, inside the directory cd into node_modules\npm folder and finally: $ npm install node-gyp@latest

Share:
37,115

Related videos on Youtube

Gags
Author by

Gags

I am a Web Designer and Developer with still a lot more to learn and skills as PHP Laravel Angular React jQuery HTML 5 Bootstrap MySQL Database

Updated on July 09, 2022

Comments

  • Gags
    Gags almost 2 years

    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"
      }
    }
    
    • stijn
      stijn about 9 years
      Are you starting npm from a 'Visual Studio commandline' (see start menu)? VCBuild is part of VS2008 (and older) so it looks like npm cannot figure out you have VS2010. Also I don't know what you mean with (updated path in the variable) but you shouldn't do anything manually, always run VS command prompt.
    • Gags
      Gags about 9 years
      nop.. i am doing npm stuff from cmd.exe . updated path means i updated environment variables with visual path
    • stijn
      stijn about 9 years
      Well did you set all environment variables for VS (there's like 10 of them)? Did you already try using a proper VS command prompt?
    • Gags
      Gags about 9 years
      m nt sure of 10 variables.. VS command prompt i cant find
    • Jesper
      Jesper about 9 years
      How is ruby a relevant tag for this question?
    • Gags
      Gags about 9 years
      because i need ruby also to get somethings to work...
    • stijn
      stijn about 9 years
      Start->All Programs->Microsoft Visual Studio 2010->Visual Studio Tools->Developper command prompt
    • Shilan
      Shilan almost 7 years
      I have the same problem. But the thing is my company pc is behind a proxy, that's why it complains and cannot go behind proxy. I don't know how to resolve it :|
  • Luís Cunha
    Luís Cunha over 7 years
    this did it for me, the global command also fixed problems with other packaged like bcrypt.
  • Lordran
    Lordran about 6 years
    And a command "npm config set msvs_version 2015 --global" follows it :)
  • ThanhPhan
    ThanhPhan over 2 years
    This works for me. Just add a minor thing: I need to run this in PowerShell (Run as Administrator)