简体   繁体   English

吉普错误! 堆栈错误:`C:\\Program Files (x86)\\MSBuild\\12.0\\bin\\msbuild.exe` 失败,退出代码:1

[英]gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1

When I run npm install , I face the following error.当我运行npm install ,我面临以下错误。 I am not able to find the problem.我找不到问题所在。

I need some help in finding this issue.我需要一些帮助来找到这个问题。

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

FYI, I am using windows 7 machine.仅供参考,我使用的是 Windows 7 机器。

Also, have the following installed:此外,请安装以下内容:

  • Visual C++ Redistributable 2013 (32 bit) Visual C++ Redistributable 2013(32 位)

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

  • Visual studio Express 2013 Visual Studio Express 2013

  • .Net framework 4.5 SDK .Net 框架 4.5 SDK

Thanks in Advance.提前致谢。

Update:更新:

A new package will do all of this for us now.现在,一个新的软件包将为我们完成所有这些工作。

Make sure you have the sufficient permissions by running:通过运行确保您有足够的权限:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

then run:然后运行:

npm install -g windows-build-tools

wait for it to install and then run:等待它安装,然后运行:

window-build-tools

and everything should be in its finest order.一切都应该是最好的秩序。


Old answer:旧答案:

I just went through some of the same issues as you.我刚刚经历了一些和你一样的问题。 I spun up a fresh installation of Windows 8.1 in Hyper-V, went through the installation process and jotted things down a long the way.我在 Hyper-V 中启动了 Windows 8.1 的全新安装,完成了安装过程并记下了很长一段路。 It seems that you have all the necessary tools installed.您似乎已经安装了所有必要的工具。

I think the only think you might be missing (not being entirely sure though) could be setting the msvs_version -flag when running npm install - so try seeing if this helps:我认为您可能遗漏的唯一想法(虽然不完全确定)可能是在运行npm install时设置msvs_version -flag - 所以尝试看看这是否有帮助:

npm install --msvs_version=2013

Now that I've done all these notes I might as well put them here, so people that experience the same kind of problems might find some help.既然我已经完成了所有这些笔记,我不妨将它们放在这里,以便遇到相同问题的人可能会找到一些帮助。

My recipe on a freshly installed machine:我在新安装的机器上的食谱:

1) Install Node.js 1)安装 Node.js

2) Install git 2)安装git

  • CLI commands should be executed with administrator rights CLI 命令应以管理员权限执行
  • Select "Use Git and optional Unix tools from the Windows Command Prompt选择“从 Windows 命令提示符中使用 Git 和可选的 Unix 工具

    • git-add-to-path

3) Upgrade npm to npm 3.xx (optional step) 3)将 npm 升级到 npm 3.xx (可选步骤)

Even though you've just installed Node.js it doesn't necessarily mean you have npm in version 3.即使您刚刚安装了 Node.js,也并不一定意味着您在版本 3 中安装了 npm。

  • CLI commands should be executed with administrator rights CLI 命令应以管理员权限执行
  • Run npm install -g npm-windows-upgrade in the command line interface.在命令行界面中运行npm install -g npm-windows-upgrade
  • Run Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force in the command line interface在命令行界面中运行Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
  • Run npm-windows-upgrade in the command line interface在命令行界面运行npm-windows-upgrade
  • Select the newest version and let it install选择最新版本并安装
  • When it finishes the install run npm --version and make sure it responds with something like 3.xx当它完成安装运行npm --version并确保它响应类似于3.xx

4) Install Python 2.7.x 4)安装 Python 2.7.x

  • Go to https://www.python.org/downloads转到https://www.python.org/downloads
  • Click the button to download Python 2.7.x点击按钮下载Python 2.7.x
  • Run the installer.运行安装程序。
  • Select Install for all users - click next.选择Install for all users - 单击下一步。
  • Select to install in C:\\Python27 - click next选择安装在C:\\Python27点击下一步

    • 蟒蛇位置
  • Be sure to select Will be installed on local hard drive in Add python.exe to Path - click next一定要在Add python.exe to Path选择Will be installed on local hard drive - 点击下一步

    • python-add-to-path-01

    • python-add-to-path-02

    • python-add-to-path-03

  • Finish up the installation完成安装

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

Even if you have another version of Visual Studio installed on your system do install this as well.即使您的系统上安装了另一个版本的 Visual Studio,也要安装它。

  • Go to http://www.microsoft.com/en-gb/download/details.aspx?id=44914转到http://www.microsoft.com/en-gb/download/details.aspx?id=44914
  • Select English or some other available language and click Download选择English或其他一些可用语言,然后单击Download
  • Check wdexpress_full.exe and click "Next"检查wdexpress_full.exe并单击“下一步”
  • Run the file downloaded.运行下载的文件。 Begin the installation.开始安装。
  • If you're unable to start the installation, it means you already have the necessary tools for this step.如果您无法开始安装,则表示您已经拥有执行此步骤所需的工具。 Abort the installation.中止安装。

Now run npm install --msvs_version=2013 and you should be able to reach the end without node-gyp throwing errors.现在运行npm install --msvs_version=2013 ,你应该能够在没有 node-gyp 抛出错误的情况下到达终点。

For me on Windows 10 and Node 13, I had to uninstall Visual Studio and Build Tools, and uninstall Node 13. Then, I deleted npm and npm-cache from Roaming, before reinstalling Node 11.6 and choosing to install Chocolately.对于我在 Windows 10 和 Node 13 上,我必须卸载 Visual Studio 和 Build Tools,然后卸载 Node 13。然后,我从 Roaming 中删除了 npm 和 npm-cache,然后重新安装 Node 11.6 并选择安装 Chocolately。 It worked for me thereafter.此后它对我有用。

对我来说,这是因为我正在运行节点 14。尝试将节点版本降级到节点 12。如果您使用 NVM,这很容易做到

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe ' 退出失败 - ERROR: C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit "C:\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\2019\\\\BuildTools\\\\VC\\\\Tools\\\\MSVC\\\\14.29.30133\\\\bin\\\\HostX86\\\\x86\\\\cl.exe&#39; 失败退出状态为 2" - C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2 Python 错误:命令 &#39;C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\bin\\\\cl.exe&#39; 失败,退出状态为 2 - Python error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2 Python错误:命令&#39;C:\\\\ Program Files(x86)\\\\ Microsoft Visual Studio 14.0 \\\\ VC \\\\ BIN \\\\ cl.exe&#39;失败,退出状态为4 - Python error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 4 Python pip安装错误:命令“ C:\\\\ Program Files(x86)\\\\ Microsoft Visual Studio 14.0 \\\\ VC \\\\ BIN \\\\ cl.exe”失败,退出状态为2 - Python pip install error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2 安装tesserocrerror命令&#39;C:\\\\ Program Files(x86)\\\\ Microsoft Visual Studio 14.0 \\\\ VC \\\\ BIN \\\\ x86_amd64 \\\\ cl.exe&#39;失败,退出状态为2 - install tesserocrerror command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 Python pip install cvxopt 错误:命令 &#39;C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\BIN\\\\x86_amd64\\\\cl.exe&#39; failed with exit status 2 - Python pip install cvxopt error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 启动器中的致命错误:无法使用“C:\Program Files (x86)\Python33\python.exe”“C:\Program Files (x86)\Python33\pip.exe”创建进程 - Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe"" 如何使用python从“ C:\\ Program Files(x86)”运行“ .exe”文件? - How to run an “.exe” file from “C:\Program Files (x86)” using python? 在 Python/PIP 中安装 REBOUND 时出错:…Microsoft Visual Studio\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 - Error with installing REBOUND in Python/PIP: …Microsoft Visual Studio\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM