我有 MS Visual Studio 2012 Ultimate,操作系统是 Windows 7,并且安装了 nodeJs。我想使用 npm 安装 socket.io,但出现以下错误。
C:\Users\NEW>npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io-client/0.9.11
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.11
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/options
> [email protected] /cdn-cgi/l/email-protection install C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-c
lient\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-client\node_modules\w
s>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo
dules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
If the component is not installed, either 1) install the Microsoft Windows SDK
for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual
Studio 2008. [C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-clie
nt\node_modules\ws\build\binding.sln]
MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
If the component is not installed, either 1) install the Microsoft Windows SDK
for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual
Studio 2008. [C:\Users\NEW\node_modules\socket.io\node_modules\socket.io-clie
nt\node_modules\ws\build\binding.sln]
[email protected] /cdn-cgi/l/email-protection node_modules\socket.io
├── [email protected] /cdn-cgi/l/email-protection
├── [email protected] /cdn-cgi/l/email-protection
├── [email protected] /cdn-cgi/l/email-protection
└── [email protected] /cdn-cgi/l/email-protection (xmlhttprequest@1.4.2, [email protected] /cdn-cgi/l/email-protection, active-x-obf
[email protected] /cdn-cgi/l/email-protection, [email protected] /cdn-cgi/l/email-protection)
可能是什么问题?我该如何解决?
抱歉挖出一个老问题,但你的问题是我搜索“Socket.io VCBuild”时的第一个结果
我偶然发现的解决方案堆栈溢出 https://stackoverflow.com/questions/14180012/npm-install-for-some-packages-sqlite3-socket-io-fail-with-error-msb8020-on-wi was:
npm install socket.io --msvs_version=2012
Update来自@petf-felzmann。如果您使用的是 VS 2015,您可以使用:
npm install socket.io --msvs_version=2015
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)