【问题标题】:Pubspec.yaml throwing inconsistent errors and no conflictsPubspec.yaml 抛出不一致的错误并且没有冲突
【发布时间】:2015-10-18 03:42:47
【问题描述】:

我发现 Dartson 和 mongo_dart 有一个奇怪的问题。

我正在运行 mongo_dart 0.1.46。 - 我需要将它升级到 mongo_dart 0.2.4

但是,当我升级 mongo_dart - 我收到以下关于 dartson 的错误

包 mongo_dart 没有匹配 0.2.4 的版本来自: - 门票取决于版本 0.2.4

使用:

dependencies:
#Server Dependencies
  json_object: "1.0.19"
  mongo_dart: "0.2.4"
  connection_pool: "0.1.0+2"
  dartson: "0.2.4"
  guinness: "0.1.17"
  html: "0.12.2"
  shelf: '>=0.6.2 <0.7.0'
  shelf_static: "0.2.2"
  shelf_route: "0.14.0"

这很奇怪,因为 mongo_dart: '0.2.4' 存在于 pub.dartlang 中,并且它是独立工作的 https://pub.dartlang.org/packages/mongo_dart


通过测试 pubspec.yaml 中每个单独包的删除,我能够确定与 dartson 的冲突。

如果我将 dartson 移到依赖项列表的顶部,我会得到相反的结果:

dependencies:
#Server Dependencies
  dartson: "0.2.4"
  json_object: "1.0.19"
  mongo_dart: "0.2.4"
  connection_pool: "0.1.0+2"
  guinness: "0.1.17"
  html: "0.12.2"
  shelf: '>=0.6.2 <0.7.0'
  shelf_static: "0.2.2"
  shelf_route: "0.14.0"

包 dartson 没有与 0.2.4 匹配的版本来自: - 门票取决于版本 0.2.4

同时删除 dartson 允许 mongo_dart 正确安装。

这两个库之间是否存在已知问题?是否存在未浮出水面的冲突?

问题:如何让 mongo_dart 0.2.4 与 Dartson 0.2.4 一起运行

【问题讨论】:

    标签: mongodb dart dart-pub dartson


    【解决方案1】:

    我已经在您的 pubspec 上以详细模式运行 pub get,问题似乎在于包 logging 的不同依赖项 Dartson 依赖于 0.9 版本,mongo_dart 依赖于当前版本 0.11 你可以询问 dartson 的作者,他们是否考虑过logging的当前版本@

    同时,您可以尝试将 dependency_ovverride 添加到您的 pubspec。当我将 ovverride 添加到您的 pubspec 时,它对我有用

    name: test_pubspec
    
    dependencies:
      json_object: "1.0.19"
      mongo_dart: "0.2.4"
      connection_pool: "0.1.0+2"
      dartson: "0.2.4"
      guinness: "0.1.17"
      html: "0.12.2"
      shelf: '>=0.6.2 <0.7.0'
      shelf_static: "0.2.2"
      shelf_route: "0.14.0"
    dependency_overrides:
      logging: '^0.11.0'
    

    【讨论】:

      猜你喜欢
      • 2021-04-16
      • 1970-01-01
      • 1970-01-01
      • 2017-07-31
      • 2020-08-24
      • 2018-06-03
      • 1970-01-01
      • 1970-01-01
      • 2019-07-05
      相关资源
      最近更新 更多