question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate "pub get" to "dart pub get"

See original GitHub issue

The top-level pub command is scheduled for deprecation in favor of dart pub.

We added dart pub in version 2.10.0, so it might still be necessary to call pub get for some older versions of the Dart SDK. However, we plan to insert a deprecation warning in the top-level pub command, in Dart 2.12.0 (next stable release of the Dart SDK). Hence, to avoid users experiencing a deprecation warning in pub get output, it would be preferable to migrate to dart pub get now.

See also: https://github.com/dart-lang/pub/issues/2736

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Nov 10, 2020

There is also dart test now, for running tests.

Currently we’re running tests by running dart [pub snapshot path]. This is to get the same pause-on-start behaviour as when running non-tests on the VM (so we don’t need to have separate code to handle this). This isn’t ideal, but it seemed better than having to maintain separate code to handle this.

We used to set DART_VM_OPTIONS=--pause_isolates_on_start=true but that had the issue of cascading to child processes too, which can mess up user tests that spawn Dart instances. There’s a little discussion about that in https://github.com/dart-lang/pub/issues/1018.

So for now, unless you think there will be breakage, I’ll leave the tests as-is but fix up the rest.

0reactions
jonasfjcommented, Nov 9, 2020

Yes, all pub commands should use dart pub 😃

There is also dart test now, for running tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dart pub get
Get is one of the commands of the pub tool. ... This command gets all the dependencies listed in the pubspec.yaml file in...
Read more >
Updating your pub package to Dart 2 | by Filip Hracek - Medium
There's a migration guide here: dartlang.org/dart-2. Go read it, it has really useful bits of information, like the existence of the dart2_fix tool,...
Read more >
convert | Dart Package - Pub.dev
Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types.
Read more >
Using packages - Flutter documentation
Run flutter pub get in the terminal, or click Packages get in IntelliJ or Android Studio. Open lib/main.dart and replace its full contents...
Read more >
Dart: pub get vs pub upgrade - Stack Overflow
If a dependency isn't locked, pub will get the latest version of that dependency that satisfies all the version constraints. This is the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found