MSBUILD:错误MSB3428:无法加载Visual C++组件"VCBuild.exe"

Gag*_*ags 18 ruby python msbuild node.js node-gyp

我想nodejs从很长一段时间安装.我尝试通过谷歌搜索,但严重的是我没有任何有效的解决方案.

我的第一个问题是

  1. 为什么Nodejs需要Microsoft Visual组件?

其次根据谷歌的建议我尝试下面的事情

  • 安装Visual C++ 2010(变量中的更新路径)但安装后我得到了更多错误,包括"MSBUILD:错误MSB3428:无法加载Visual C++组件"VCBuild.exe".
  • 我们已经完成https://github.com/TooTallNate/node-gyp了删除错误,但仍然无法正常工作.
  • 再次卸载并安装了Node js,但没有成功.

我有以下版本

  • 节点js 0.12
  • Python 2.7
  • Ruby 1.9.3
  • Windows 7 64位.

当我运行时npm-install,错误显示如下

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 Visual Studio 2005 or 3) add the location of the 
component to the system path if it is installed elsewhere. 
Run Code Online (Sandbox Code Playgroud)

package.json的如下:

{
 "name": "TRest",
 "version": "0.1.0",
 "devDependencies": {
     "grunt": "~0.4.2",
     "grunt-contrib-watch": "~0.5.3",
     "grunt-sass": "~0.11.0",
     "grunt-pixrem": "^0.1.2",
     "grunt-legacssy": "^0.2.0",
     "grunt-contrib-concat": "~0.3.0",
     "grunt-contrib-uglify": "~0.3.2",
     "node-bourbon": "^1.0.0"
  }
}
Run Code Online (Sandbox Code Playgroud)

Ber*_*ger 15

你可以通过这样做告诉npm使用Visual Studio 2010 ...

npm install socket.io --msvs_version=2010
Run Code Online (Sandbox Code Playgroud)

将socket.io替换为提供问题的包.

也可以为npm设置全局设置:

npm config set msvs_version 2010 --global
Run Code Online (Sandbox Code Playgroud)


Bad*_*laj 7

或者尝试 npm install --global --production windows-build-tools

  • 然后是一个命令“npm config set msvs_version 2015 --global” :) (2认同)

小智 7

使用具有管理权限的 PowerShell 并运行:

npm install --global --production windows-build-tools@4.0.0
Run Code Online (Sandbox Code Playgroud)

之后就可以顺利工作了。