我正在尝试在 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.io
、express
和 connect
。
确保所有必需的二进制文件都已编译并加载到 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/