Not able to install socket.io on Windows server 2012

自古美人都是妖i 提交于 2020-01-15 09:09:53

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/22681477/not-able-to-install-socket-io-on-windows-server-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!