【问题标题】:Not able to install socket.io on Windows server 2012无法在 Windows Server 2012 上安装 socket.io
【发布时间】: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


【解决方案1】:

我发现这个问题的唯一解决方案:

----不要在服务器上编译二进制文件,而是在本地系统上编译。

在本地系统上安装所有二进制文件,如 Socket.ioexpressconnect。 确保所有必需的二进制文件都已编译并加载到 node_modules 文件夹中。

只需 FTP 到您服务器上的那个文件夹。 (确保服务器上安装了python 2.7

运行

node server.js //or yourFile.js

这应该可以正常工作。

【讨论】:

    猜你喜欢
    • 2016-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-19
    • 1970-01-01
    • 2013-03-02
    • 2014-01-11
    • 1970-01-01
    相关资源
    最近更新 更多