我有一个带有聚合物的Dart项目和简单的聚合物元素fany_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
我不明白
我也遇到过类似的问题。
第一个pubspec.yaml正如错误消息中所说,fany_button依赖于聚合物的特定版本,但您在第一个pubspec中说。您想要0.10.0版本的Yaml,但:0.10> 0.9.1.
所以在pubspec中。fancy_button的Yaml,条件:
polymer: ">=0.9.0+1 <0.9.1"
不为真,因此它表示发生了问题。
在第二个pubspec.yaml在第二个pubspec中,您说您需要任何版本的聚合物,因此当发布工具将搜索以获得最佳匹配时,它将看到fany_button需要0.9版本。X,并且没有其他包需要不同的版本,因此它将下载0.9版本的聚合物包。
这似乎解决了问题,但为什么呢?
name: woven_sandbox
dependencies:
angular: any
angular_node_bind: any
browser: any
polymer: any
shadow_dom: any
transformers:
- polymer:
entry_points:
- web/hello_world.html