python - 吉普错误!堆栈错误 : `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1

标签 python c++ node.js msbuild

当我运行 npm install 时,我遇到了以下错误。我找不到问题所在。

我需要一些帮助来找到这个问题。

d:\testing\node-sample-module\node_modules\ffi\node_modules\ref\node_modules\nan\nan_implementation_pre_12_inl.h(112): error C2668: 'v8::FunctionTemplate::New' :  ambiguous call to overloaded function [d:\TESTING\node-sample-module\node_modules \ffi\node_modules\ref\build\binding.vcxproj]
C:\Users\SELVA\.nw-gyp\0.8.5\deps\v8\include\v8.h(3344): could be 'v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::FunctionCallback,v8::Handle<v8::Value>,v8::Handle<v8::Signature>,int)'
C:\Users\SELVA\.nw-gyp\0.8.5\deps\v8\include\v8.h(3343): or v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::InvocationCallback,v8::Handle<v8::Value>,v8::Handle<v8::Signature>,int)' while trying to match the argument list '(int, v8::Local<v8::Value>,    v8::Local<v8::Signature>)'

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\Users\SELVA\AppData\Roaming\npm\node_modules\nw-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Users\\SELVA\\AppData\\Roaming\\npm\\node_modules\\nw-gyp\\bin\\nw-gyp.js" "clean" "configure" "--target=0.8.5" "build" "--arch=ia32"
gyp ERR! cwd d:\TESTING\node-sample-module\node_modules\ffi\node_modules\ref
gyp ERR! node -v v0.10.35
gyp ERR! nw-gyp -v v0.12.4
gyp ERR! not ok

仅供引用,我使用的是 Windows 7 机器。

另外,安装以下:

  • Visual C++ Redistributable 2013(32 位)

  • Python 2.7.3(环境变量设置为 path/python.exe)

  • Visual Studio Express 2013

  • .Net framework 4.5 SDK

提前致谢。

最佳答案

更新:

现在一个新包将为我们完成所有这些工作。

通过运行确保您有足够的权限:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

然后运行:

npm install -g windows-build-tools

等待它安装然后运行:

窗口构建工具

一切都应该处于最佳状态。


旧答案:

我刚刚遇到了一些与您相同的问题。我在 Hyper-V 中启动了 Windows 8.1 的全新安装,完成了安装过程并记下了很长一段时间的事情。看来您已经安装了所有必要的工具。

我认为你唯一可能遗漏的(虽然不完全确定)可能是在运行 npm install 时设置 msvs_version - 标志 - 所以试试看看这个帮助:

npm install --msvs_version=2013

既然我已经完成了所有这些笔记,我不妨将它们放在这里,这样遇到同样问题的人可能会得到一些帮助。

我在新安装的机器上的食谱:

1) 安装 Node.js

2) 安装git

  • CLI 命令应以管理员权限执行
  • 选择“从 Windows 命令提示符使用 Git 和可选的 Unix 工具”

    • > git-add-to-path

3) 将 npm 升级到 npm 3.x.x(可选步骤)

即使您刚刚安装了 Node.js,也并不一定意味着您在版本 3 中安装了 npm。

  • CLI 命令应以管理员权限执行
  • 在命令行界面中运行 npm install -g npm-windows-upgrade
  • 在命令行界面中运行 Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
  • 在命令行界面运行npm-windows-upgrade
  • 选择最新版本并安装
  • 安装完成后,运行 npm --version 并确保它响应类似 3.x.x
  • 的内容

4) 安装Python 2.7.x

  • 转到 https://www.python.org/downloads
  • 点击按钮下载Python 2.7.x
  • 运行安装程序。
  • 选择为所有用户安装 - 点击下一步。
  • 选择安装在C:\Python27 - 点击下一步

    • > python-location
  • 一定要在Add python.exe to Path中选择Will be installed on local hard drive - 点击next

    • python-add-to-path-01

    • python-add-to-path-02

    • python-add-to-path-03

  • 完成安装

5) 安装 Visual Studio Express 2013 for Windows Desktop with Update 4

即使您的系统上安装了另一个版本的 Visual Studio,也要安装它。

  • 转到 http://www.microsoft.com/en-gb/download/details.aspx?id=44914
  • 选择English 或其他一些可用的语言,然后单击下载
  • 选中wdexpress_full.exe并点击“下一步”
  • 运行下载的文件。开始安装。
  • 如果您无法开始安装,则表示您已经拥有执行此步骤所需的工具。中止安装。

现在运行 npm install --msvs_version=2013,您应该能够在没有 node-gyp 抛出错误的情况下到达终点。

关于python - 吉普错误!堆栈错误 : `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32964144/

相关文章:

c++ - 静态变量声明和定义

c++ - 通过LLVM/Clang与MyLanguage Converter进行C++往返

javascript - 将获取请求从一个 node.js 服务器转发到另一个

javascript - async/await 隐式返回 promise ?

python - 将 decodebin 与加法器一起使用

python - 当指定父窗口时,PyQt5 窗口未在 show() 上打开

python - 如果前 x 行值相同,如何删除 Pandas 数据框中的相同列?

C++字符串匹配(主机名和端口)

python - Sqlalchemy 返回元组

node.js + mongodb + 多个实体的原子更新 = 头疼