【发布时间】:2014-03-27 08:02:15
【问题描述】:
我正在尝试在 Windows Server 2012 上安装 Socket.io
npm install socket.io
我得到的错误是
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)
我已经安装了框架 2.0,但我必须购买 Visual Studio 2005 的许可证才能安装在服务器上吗?还是真的需要安装?还是有一些服务器版本的替代编译器?
我的问题背后的原因是在 windows server 2008 上进行的相同设置不会引发任何错误。我没有在 windows server 2008 上安装任何特别的东西。 问题仅出在 Server 2012 上。 可能的出路是什么?
【问题讨论】:
-
该错误是由
ws模块引起的,需要编译才能运行,您应该安装所需的.NET 2.0和Visual Studio标准版。不太记得我是如何安装ws模块的,但我相信 VisualStudio 并不强制编译它。 -
你能得到这方面的任何信息吗?我被严重困在这里......
-
你能在那台机器上执行以下操作吗?
npm uninstall ws socket.io socket.io-client然后npm install ws socket.io socket.io-client -V然后打开一个nodejs shell,并执行以下var socketIOClient=require('socket.io-client');如果它返回undefined模块加载正确, 之后输入socketIOClient会返回socket.io-client对象。
标签: node.js sockets socket.io windows-server-2012 vcbuild