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

MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe"

我一直在尝试安装 nodejs。我尝试在 google 上搜索,但说真的,我没有找到任何可行的解决方案。

我的第一个问题是

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

其次,根据 google 的建议,我尝试了以下操作

我有以下版本

当我运行 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. 

我的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"
  }
}

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

npm install socket.io --msvs_version=2010

将 socket.io 替换为出现问题的软件包。

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

npm config set msvs_version 2010 --global

我在尝试安装 strongloop 时收到此错误“MSBUILD:错误 MSB3428:无法加载 Visual C++ 组件“VCBuild.exe”。 我能够通过 运行 解决这个问题。

在您的 windows 上找到节点 $ npm install -g 其中 $ 哪个节点 cd 进入目录后,在目录内 cd 进入 node_modules\npm 文件夹,最后: $ npm 安装 node-gyp@latest

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

我个人得到这个是因为无法获取 python2 路径。您可以安装 python 2 并在环境变量中设置路径,或者找到安装在您同事机器某处的 node-gyp 模块并将其粘贴到您的 node_modules 文件夹中。

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

npm install --global --production windows-build-tools@4.0.0

之后就可以顺利运行了