node.js - 无法在 Windows Server 2012 上安装 socket.io

标签 node.js sockets socket.io windows-server-2012 vcbuild

我正在尝试在 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)

我已经安装了framework 2.0,但是我是否需要购买Visual Studio 2005的许可证才能安装在服务器上?或者说真的有必要安装吗?或者是否有一些适用于服务器版本的替代编译器?

我的问题背后的原因是,在 Windows Server 2008 上完成的相同设置不会引发任何错误。我没有在 Windows Server 2008 上安装任何特殊的东西。 该问题仅出现在 Server 2012 上。 可能的出路是什么?

最佳答案

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

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

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

只需通过 FTP 传输服务器上的该文件夹即可。 (确保服务器上安装了python 2.7)

运行

node server.js //or yourFile.js

那应该可以正常工作。

关于node.js - 无法在 Windows Server 2012 上安装 socket.io,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22681477/

相关文章:

javascript - 使用 Spring Boot 构建短信和视频通话应用程序

node.js - nodejs 无法使用 SSL

java - readShort()期间如果出现超时异常,socket接收到的数据会发生什么情况?

node.js - SocketIO 连接被拒绝

javascript - 为什么在这种情况下我不能使用 socket.emit.broadcast ?

javascript - 400错误请求(使用node和socket.io制作游戏)

javascript - 如何仅在需要时运行 Google Cloud SQL?

node.js - 如何导出 IV 和 key 到 crypto.createCipheriv 进行解密?

sockets - 如何在 Mosquitto 中同时启用 TCP 和 Web 套接字?

java - 持久 TCP 连接客户端/服务器