Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSB3411 Could not load Visual C++ component

I have MS Visual Studio 2012 Ultimate and OS is Windows 7, and have nodeJs installed.I wanted to install socket.io using npm,but I get the following error.

C:\Users\NEW>npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io-client/0.9.11
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.11
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/options

> [email protected] install C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-c
lient\node_modules\ws

> (node-gyp rebuild 2> builderror.log) || (exit 0)

C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-client\node_modules\w
s>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo
dules\node-gyp\bin\node-gyp.js" rebuild

Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.

MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
 If the component is not installed, either 1) install the Microsoft Windows SDK
 for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual
 Studio 2008.  [C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-clie
nt\node_modules\ws\build\binding.sln]

MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
 If the component is not installed, either 1) install the Microsoft Windows SDK
 for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual
 Studio 2008.  [C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-clie
nt\node_modules\ws\build\binding.sln]

[email protected] node_modules\socket.io
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected], [email protected], active-x-obf
[email protected], [email protected])

What might be the issue?How can I fix it?

like image 934
Aravind Avatar asked Jan 17 '13 13:01

Aravind


3 Answers

Sorry to dig up an old question, but your question is the first result when I searched for "Socket.io VCBuild"

The solution I found, after stumbling around on StackOverflow was:

npm install socket.io --msvs_version=2012

Update from @petf-felzmann. If you're using VS 2015 you can use:

npm install socket.io --msvs_version=2015

like image 111
Jason Kulatunga Avatar answered Oct 16 '22 07:10

Jason Kulatunga


Install dotnet 3.5, so the websockets may be compiled

http://www.microsoft.com/en-us/download/details.aspx?id=21

like image 40
randunel Avatar answered Oct 16 '22 08:10

randunel


Make sure you have all the pre-requisite software to run node-gyp:

  • https://github.com/TooTallNate/node-gyp

You can configure version of Visual Studio used by gyp via an environment variable so you can avoid having to set the --msvs_version=2012 property.

Examples:

  • set GYP_MSVS_VERSION=2012 for Visual Studio 2012
  • set GYP_MSVS_VERSION=2013e (the 'e' stands for 'express edition')

For the full list see - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294

This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.

Feel free to add your vote at:

  • https://github.com/joyent/node/issues/8005#issuecomment-50545326
like image 1
Tony O'Hagan Avatar answered Oct 16 '22 08:10

Tony O'Hagan