我有一个Dart项目,其中包含聚合物和简单的Polymer元素fancy_button。我想添加AngularDart,因此可以通过将包添加到pubspec.yaml
中来实现,如下所示:
name: woven_sandbox
dependencies:
browser: any
polymer: ">=0.10.0 <0.11.0"
fancy_button: any
angular: 0.10.0
shadow_dom: any
transformers:
- angular
- polymer:
entry_points:
- web/hello_world.html
当我尝试
pub get
时,出现以下奇怪的版本约束问题:$ pub get
Resolving dependencies... (6.1s)
Incompatible version constraints on polymer:
- fancy_button 0.0.1 depends on version >=0.9.0+1 <0.9.1
- woven_sandbox 0.0.0 depends on version >=0.10.0 <0.11.0
我不明白
最佳答案
我有一个类似的问题。 polymer: ">=0.9.0+1 <0.9.1"
您的第一个pubspec.yaml中的
如错误消息中所述,fancy_button取决于聚合物的特定版本,但是您在第一个pubspec.yaml中说您想要的版本是0.10.0,但是:0.10> 0.9.1。
因此,在fancy_button的pubspec.yaml中,条件为:
是不正确的,所以说发生了问题。
您第二个pubspec.yaml中的
在您的第二个pubspec中,您说您需要任何版本的Polymer,因此当pub工具搜索以获取最佳匹配时,它将看到fancy_button需要版本0.9.X,并且没有其他程序包需要其他版本,因此它将下载0.9版的聚合物包装。
关于dart - AngularDart对聚合物的不兼容版本限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24298463/