当我运行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
仅供参考,我正在使用Windows7机器。
另外,请安装以下组件:
Python 2.7.3(env变量设置为path/Python.exe)
Visual studio速成版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安装程序,完成了安装过程,并在很长一段时间里把事情记下来。看来你已经安装了所有必要的工具。
我认为您可能丢失的唯一想法(虽然不完全确定)可能是在运行
msvs_version
时设置npm install
标志,所以请尝试查看这是否有帮助:既然我已经做了这些笔记,我不妨把它们放在这里,这样那些遇到同样问题的人可能会找到一些帮助。
我在新安装的机器上的食谱:
1)安装Node.js
2)安装git
从Windows命令提示符中选择“使用Git和可选的Unix工具
3)将npm升级到npm 3.x.x(可选步骤)
即使您刚刚安装了Node.js,也不一定意味着您在版本3中安装了npm。
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
Install for all users
-单击“下一步”。选择在
C:\Python27
中安装-单击“下一步”确保在
Add python.exe to Path
中选择Will be installed on local hard drive
-单击“下一步”完成安装
5)使用更新4安装Visual Studio Express 2013 for Windows桌面版
即使您的系统上安装了另一个版本的Visual Studio,也要安装它。
English
或其他可用语言,然后单击Download
wdexpress_full.exe
,然后单击“下一步”现在运行
npm install --msvs_version=2013
,您应该能够在没有节点gyp抛出错误的情况下到达末尾。相关问题 更多 >
编程相关推荐