Skip to content

Pub fails: Package path has no versions that match <empty> #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DartBot opened this issue Jun 4, 2015 · 6 comments
Closed

Pub fails: Package path has no versions that match <empty> #25

DartBot opened this issue Jun 4, 2015 · 6 comments
Labels
closed-as-intended Closed as the reported issue is expected behavior type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jun 4, 2015

Originally opened as dart-lang/sdk#23485

This issue was originally filed by [email protected]


I'm trying to build a project that was already built successfully a year ago,
but today (with pub 1.10.0) pub get fails to resolve it's dependencies

To reproduce the problem, git clone this https://github.com/sethladd/tilebasedwordsearch project
and then run pub get in it.

It says the following:

Resolving dependencies... (27.0s)
Package path has no versions that match <empty> derived from:

  • analyzer 0.13.6 depends on version >=0.9.0 <2.0.0
  • barback 0.13.0 depends on version >=0.9.0 <2.0.0
  • google_oauth2_client 0.3.7 depends on version >=1.0.0 <1.2.0
  • http 0.9.2+3 depends on version >=0.9.0 <2.0.0
  • http_server 0.9.2 depends on version >=0.9.0 <2.0.0
  • polymer 0.10.0-pre.10 depends on version >=0.9.0 <2.0.0
  • source_span 1.1.2 depends on version >=1.2.0 <2.0.0
  • stack_trace 0.9.3+1 depends on version >=1.0.0-rc.1 <2.0.0
  • wordherd 0.3.0 depends on version any

I'm using dart sdk 1.10.0 on macosx

I know there is a bad style of pubspec.yaml where most of the packages marked as any instead of versions,
and i tried to put there a versions from pubspec.lock file, but without any success.
Errors in pub get are varying during version substitution, but result is the same.
Tracing it with pub get --verbose, i found the following line, not sure if it's ok:

SLVR: | | | | | | | | | | | no versions for path match <empty>

Starting from it, pub get tries to vary other packages versions, but still fails.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/3276024?v=3" align="left" width="48" height="48"hspace="10"> Comment by anders-sandholm


Added Area-Pub, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


This isn't really an issue with pub. Your package's dependencies don't allow any version of path, and pub is telling you why.

I suggest filing an issue against google_oauth2_client, since its (highly unusual) ">=1.0.0 <1.2.0" dependency on path seems to be the root of the problem.


Added AsDesigned label.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

This comment was originally written by [email protected]


Ok, I got it. But I'm sure this project was built in the past.
So here is 2 questions:

  1. How it could if no such combination of package versions exist?
  2. Is there any way to force pub load all these versions listed in pubspec.lock, ignoring dependencies, to build this project as it was in the past?

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/405837?v=3" align="left" width="48" height="48"hspace="10"> Comment by zoechi


  1. This is exactly what pub get does. pub upgrade tries to find a compatible set of dependencies with the newest versions possible.
    Are you sure you run pub get and not pub upgrade?

@DartBot DartBot added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) closed-as-intended Closed as the reported issue is expected behavior labels Jun 4, 2015
@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

This comment was originally written by [email protected]


Yes, I'm sure. Double checked. pub get starts resolving dependencies and then fails. And I can't get packages listed in pubspec.lock as a consequence.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


  1. How it could if no such combination of package versions exist?

Packages can specify constraints on the Dart SDK itself, saying "I only work with these versions." It's possible that the older SDK matched these constraints for the constellation of packages you had selected, and the newer SDK does not.

  1. Is there any way to force pub load all these versions listed in pubspec.lock, ignoring dependencies, to build this project as it was in the past?

You can use dependency overrides (https://www.dartlang.org/tools/pub/dependencies.html#dependency-overrides) to force pub to select certain package versions regardless of constraints, but be aware that constraints usually exist for a reason and violating them can break your app.

This is exactly what pub get does. pub upgrade tries to find a compatible set of dependencies with the newest versions possible.

That's not quite accurate. "pub get" will prefer locked versions of packages, but if they aren't compatible for any reason it'll unlock them and try to find recent versions that work instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-as-intended Closed as the reported issue is expected behavior type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

1 participant