gpt4 book ai didi

node.js - MSB3411 无法加载 Visual C++ 组件

转载 作者:搜寻专家 更新时间:2023-10-31 22:18:54 25 4
gpt4 key购买 nike

我有 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

> ws@0.4.25 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]

socket.io@0.9.13 node_modules\socket.io
├── base64id@0.1.0
├── policyfile@0.0.4
├── redis@0.7.3
└── socket.io-client@0.9.11 (xmlhttprequest@1.4.2, uglify-js@1.2.5, active-x-obf
uscator@0.0.1, ws@0.4.25)

可能是什么问题?我该如何解决?

最佳答案

很抱歉挖出一个老问题,但你的问题是我搜索“Socket.io VCBuild”时的第一个结果

我在 StackOverflow 上跌跌撞撞后找到的解决方案是:

npm install socket.io --msvs_version=2012

来自@petf-felzmann 的

更新。如果您使用的是 VS 2015,则可以使用:

npm install socket.io --msvs_version=2015

关于node.js - MSB3411 无法加载 Visual C++ 组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14380653/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com