25

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"
  }
}
8
  • 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.
    – stijn
    Feb 20, 2015 at 8:22
  • nop.. i am doing npm stuff from cmd.exe . updated path means i updated environment variables with visual path
    – Gags
    Feb 20, 2015 at 8:31
  • 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?
    – stijn
    Feb 20, 2015 at 8:41
  • 1
    m nt sure of 10 variables.. VS command prompt i cant find
    – Gags
    Feb 20, 2015 at 8:47
  • 7
    How is ruby a relevant tag for this question?
    – Jesper
    Feb 20, 2015 at 8:50

5 Answers 5

21

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
1
  • this did it for me, the global command also fixed problems with other packaged like bcrypt. Aug 29, 2016 at 14:27
10

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

2
  • 3
    And a command "npm config set msvs_version 2015 --global" follows it :)
    – Lordran
    Mar 26, 2018 at 2:24
  • 1
    This works for me. Just add a minor thing: I need to run this in PowerShell (Run as Administrator) Dec 15, 2021 at 9:28
7

Use the PowerShell with administrative rights and run:

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

after that it will work smoothly.

1

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

0

I personally got this because python2 path couldn't be fetched. You can either install python 2 and set the the path in environment variables or find a node-gyp module installed somewhere in your colleagues machine and just paste it in your node_modules folder.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.