吉普错误!堆栈错误:`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
问题描述
当我运行 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调用重载函数 [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): 可能是 'v8::Localv8::FunctionTemplate::New(v8::FunctionCallback,v8::Handle,v8::Handle,int)'C:\Users\SELVA\.nw-gyp\0.8.5\deps\v8\include\v8.h(3343): 或 v8::Localv8::FunctionTemplate::New(v8::InvocationCallback,v8::Handle<v8::Value>,v8::Handle<v8::Signature>,int)' 同时尝试匹配参数列表 '(int, v8::Local, v8::Local)'吉普错误!构建错误吉普错误!堆栈错误:`C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` 失败,退出代码:1吉普错误!堆栈在 ChildProcess.onExit (c:\Users\SELVA\AppData\Roaming\npm\node_modules\nw-gyp\lib\build.js:267:23)吉普错误!ChildProcess.emit 上的堆栈 (events.js:98:17)吉普错误!堆栈在 Process.ChildProcess._handle.onexit (child_process.js:820:12)吉普错误!系统 Windows_NT 6.1.7601吉普错误!命令节点"c:\\Users\\SELVA\\AppData\\Roaming\\npm\\node_modules\\nw-gyp\\bin\\nw-gyp.js"clean"configure"--目标=0.8.5"构建"--arch=ia32"吉普错误!cwd d:\TESTING\node-sample-module\node_modules\ffi\node_modules\ref吉普错误!节点 -v v0.10.35吉普错误!nw-gyp -v v0.12.4吉普错误!不好
仅供参考,我使用的是 Windows 7 机器.
另外,安装以下内容:
Visual C++ Redistributable 2013(32 位)
Python 2.7.3(环境变量设置为 path/python.exe)
Visual Studio Express 2013
.Net 框架 4.5 SDK
提前致谢.
更新:
现在一个新的软件包将为我们完成所有这些工作.
通过运行确保您有足够的权限:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
然后运行:
npm install -g windows-build-tools
等待它安装然后运行:
window-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 工具
- 立>
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
- 转到
- 选择
English
或其他一些可用语言,然后点击Download
- 勾选
wdexpress_full.exe
并点击下一步" - 运行下载的文件.开始安装.
- 如果您无法开始安装,则表示您已经拥有执行此步骤所需的工具.中止安装.
现在运行 npm install --msvs_version=2013
并且你应该能够在没有 node-gyp 抛出错误的情况下到达终点.
When I run npm install
, I face the following error. 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.
Also, have the following installed:
Visual C++ Redistributable 2013 (32 bit)
Python 2.7.3 (env variable set to path/python.exe)
Visual studio Express 2013
.Net framework 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. 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=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
2) Install git
- CLI commands should be executed with administrator rights
Select "Use Git and optional Unix tools from the Windows Command Prompt
3) Upgrade npm to npm 3.x.x (optional step)
Even though you've just installed Node.js it doesn't necessarily mean you have npm in version 3.
- 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 like3.x.x
4) Install 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. Select to install in
C:\Python27
- click nextBe sure to select
Will be installed on local hard drive
inAdd python.exe to Path
- click nextFinish up the installation
5) Install 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.
- Go to http://www.microsoft.com/en-gb/download/details.aspx?id=44914
- Select
English
or some other available language and clickDownload
- 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.
Now run npm install --msvs_version=2013
and you should be able to reach the end without node-gyp throwing errors.
这篇关于吉普错误!堆栈错误:`C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` 失败,退出代码:1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!