相关文章推荐
无邪的煎饼  ·  springData 实现mongodb ...·  4 月前    · 

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

10 人关注

当我运行 npm install 时,我面临以下错误。我无法找到问题所在。

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

顺便说一下,我使用的是windows 7机器。

此外,还要安装以下内容。

  • Visual C++ Redistributable 2013 (32 bit)

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

  • Visual studio Express 2013

  • .Net框架4.5 SDK

  • 提前感谢。

    python
    c++
    node.js
    msbuild
    SELVA
    SELVA
    发布于 2015-10-06
    3 个回答
    Brian Frisch
    Brian Frisch
    发布于 2020-02-12
    已采纳
    0 人赞同

    现在,一个新的软件包将为我们做这一切。

    通过运行确保你有足够的权限。

    Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

    then run:

    npm install -g windows-build-tools

    等待它的安装,然后运行。

    window-build-tools

    而且一切都应该处于最良好的状态。

    我刚刚经历了一些和你一样的问题。我在Hyper-V中启动了一个新的Windows 8.1安装,经历了安装过程,并在很长一段时间内记下了一些东西。看起来你已经安装了所有必要的工具。

    我认为你唯一的想法可能是在运行 npm install 时设置 msvs_version -标志(虽然不是完全确定)。- 所以试试这是否有帮助。

    npm install --msvs_version=2013
    
  • CLI commands should be executed with administrator rights
  • Run npm install -g npm-windows-upgrade in the command line interface.
  • Run Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force in the command line interface
  • Run npm-windows-upgrade in the command line interface
  • 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.x.x
  • 4) 安装Python 2.7.x

  • Go to https://www.python.org/downloads
  • Click the button to download Python 2.7.x
  • Run the installer.
  • Select Install for all users - click next.
  • 选择安装在C:\Python27中- 点击下一步

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

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

  • Go to http://www.microsoft.com/en-gb/download/details.aspx?id=44914
  • Select English or some other available language and click Download
  • Check wdexpress_full.exe and click "Next"
  • 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.
  •