1

I am trying to install Socket.io on windows server 2012

npm install socket.io

The error that I am getting is

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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [D:\PushNotificationServer\node_modules\socket.io\node
_modules\socket.io-client\node_modules\ws\build\binding.sln]
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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [D:\PushNotificationServer\node_modules\socket.io\node
_modules\socket.io-client\node_modules\ws\build\binding.sln]
socket.io@0.9.6 node_modules\socket.io
├── policyfile@0.0.4
├── redis@0.6.7
└── socket.io-client@0.9.6 (xmlhttprequest@1.2.2, uglify-js@1.2.5, active-x-obfu
scator@0.0.1, ws@0.4.31)

I've installed the framework 2.0 but do I have to buy a licence for visual studio 2005 to install on server? Or is there really a need to install it? Or is there some alternative compiler for server editions?

The reason behind my question is that the same setup done on windows server 2008 does not throw any error. I did not install anything special on windows server 2008. The problem is with Server 2012 only. What could be the possible way out?

writeToBhuwan
  • 3,233
  • 11
  • 39
  • 67
  • that error is caused by `ws` module which requires to be compiled in order to run, what you should do is install the required `.NET 2.0`, and visual studio standard edition. Can't quite recall how i installed `ws` module, but i believe VisualStudio its not mandatory to compile it. – Gntem Mar 27 '14 at 09:51
  • Can you get any information on this ? I am badly stuck here... – writeToBhuwan Mar 28 '14 at 10:18
  • can you do the following on that machine.. `npm uninstall ws socket.io socket.io-client` and then `npm install ws socket.io socket.io-client -V` then open up a nodejs shell, and do the following `var socketIOClient=require('socket.io-client');` if it returns `undefined` the module loads correctly, entering `socketIOClient` afterwards will return `socket.io-client` object. – Gntem Mar 28 '14 at 12:33

1 Answers1

0

The only solution that I found to this problem:

----Instead of compiling the binaries on server, do it on local system.

Install all the binaries like Socket.io, express and connect on your local system. Make sure that all required binaries are compiled and loaded into node_modules folder.

Simply FTP that folder on your server. (Make sure that python 2.7 is installed on server)

run

node server.js //or yourFile.js

and that should work fine.

writeToBhuwan
  • 3,233
  • 11
  • 39
  • 67