【问题标题】:There is a error when I want to run `node-gyp rebuild`当我想运行 `node-gyp rebuild` 时出错
【发布时间】:2023-03-18 21:50:01
【问题描述】:

环境:Windows10 x64, nodejs v8.15.0 python:2.7.6

我想重建我的代码,最后一步是node-gyp rebuild

我收到一个错误:

MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\18363\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\18363\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Other Soft\AMO-Tools-Suite-develop
gyp ERR! node -v v8.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

我尝试使用以下方法修复它:

npm config set msvs_version 2017 -global

和:

npm install -global -production windows-build-tools

但是没有用。

【问题讨论】:

  • 你试过明显的吗?它在错误消息中:要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Visual Studio 2005;或 3) 如果组件安装在其他位置,请将其位置添加到系统路径。

标签: node-gyp


【解决方案1】:
g++ gcc libgcc libstdc++

你应该安装以上工具。

【讨论】:

  • 我正在安装VS2017和git
  • @L.Guo 不,你需要安装 gcc 编译器而不是 git。
猜你喜欢
  • 2021-10-03
  • 2012-08-12
  • 2018-02-07
  • 1970-01-01
  • 2015-08-23
  • 2014-11-29
  • 1970-01-01
  • 2020-03-19
  • 1970-01-01
相关资源
最近更新 更多