How to upgrade to Dart 2?

314 views
Skip to first unread message

Niyazi Toros

unread,
Jun 20, 2018, 6:55:08 PM6/20/18
to Dart Misc
Hi,

In my macOS I have IntelliJ and setup dart and Flutter plugin. I develop 1 Flutter mobile app and I need to use Dart to create a web services for my mobile app.
So, I need to install or upgrade to dart 2. But when I try I m getting this error. Any help please?


Error: dart-lang/dart/dart 1.24.3 already installed
Niyazis-MBP:~ niyazitoros$ brew tap dart-lang/dart
Niyazis-MBP:~ niyazitoros$ brew install dart
Warning: dart-lang/dart/dart 1.24.3 is already installed and up-to-date
To reinstall 1.24.3, run `brew reinstall dart`
Niyazis-MBP:~ niyazitoros$ brew install dart --devel
==> Installing dart from dart-lang/dart
Error: dart 1.24.3 is already installed
To upgrade to 2.0.0-dev.63.0, run `brew upgrade dart`
Niyazis-MBP:~ niyazitoros$ brew upgrade dart
Error: dart-lang/dart/dart 1.24.3 already installed
Niyazis-MBP:~ niyazitoros$ pub upgrade
Could not find a file named "pubspec.yaml" in "/Users/niyazitoros".
Niyazis-MBP:~ niyazitoros$ pub upgrade transmogrify
Could not find a file named "pubspec.yaml" in "/Users/niyazitoros".
Niyazis-MBP:~ niyazitoros$ 

Rob Becker

unread,
Jun 20, 2018, 8:17:49 PM6/20/18
to Dart Misc
Dart 2 isn't available on brew since the stable release of dart 2 is not out yet. I've been just downloading and extracting the latest dart 2 from the dev branch here and putting it in my path before the other dart.

Matan Lurey

unread,
Jun 20, 2018, 8:23:22 PM6/20/18
to mi...@dartlang.org
On Wed, Jun 20, 2018 at 5:17 PM Rob Becker <robrb...@gmail.com> wrote:
Dart 2 isn't available on brew


brew install dart --devel
 
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/7b5db07a-9590-4867-b7ff-10f3d4b09f4c%40dartlang.org.

Patrice Chalin

unread,
Jun 21, 2018, 7:33:45 AM6/21/18
to Dart Misc
Hi,

Sadly, it seems that brew assumes that all dev releases are older than stable releases. That is why "brew install dart --devel" prints "Error: dart 1.24.3 is already installed". To get around that, use the --force flag:

brew upgrade dart --devel --force

==> Upgrading 1 outdated package, with result:

dart-lang/dart/dart 1.24.3 -> 2.0.0-dev.64.1

==> Upgrading dart-lang/dart/dart 

==> Downloading https://storage.googleapis.com/dart-archive/channels/dev/release/2.0.0-dev.64.1/sdk/dartsdk-macos-x64-release.zip

...

==> Caveats

Please note the path to the Dart SDK:

  /opt/homebrew/opt/dart/libexec

==> Summary

🍺  /opt/homebrew/Cellar/dart/2.0.0-dev.64.1: 1,222 files, 372.9MB, built in 8 seconds


To switch between versions of dart use, for example:

brew switch 1.24.3

Patrice Chalin

unread,
Jun 21, 2018, 7:35:52 AM6/21/18
to Dart Misc
Another option is to use the recently added `dart@2` formula:

brew install dart@2


On Wednesday, June 20, 2018 at 6:55:08 PM UTC-4, Niyazi Toros wrote:

William Hesse

unread,
Jun 21, 2018, 7:40:28 AM6/21/18
to General Dart Discussion
Yes, the dart@2 and dart@1 formulas were added for exactly this purpose.  Until the first stable Dart 2 release is made, you must use the dart@2 formulat to get it, and after the first stable Dart 2 release is made, you will need to use the dart@1 formula to remain on Dart 1.

--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.


--
William Hesse

Niyazi Toros

unread,
Jun 21, 2018, 9:28:28 AM6/21/18
to Dart Misc
Thank you all. I upgraded to Dart2 using Patrice Chalin suggestion (brew upgrade dart --devel --force).

I am new to Dart, and I am trying to write Dart Web Api to connect internal socket api so my Flutter up securely can access it.

This is my first step, and I have to take many more.

Kind Regards
Reply all
Reply to author
Forward
0 new messages