Closed johnpryan closed 5 years ago
open ~/.bash_profile
Add this line:
# export PATH=/usr/local/opt/dart@1/bin:$PATH # Uncomment line to switch to Dart 1.24.3
Every time you want to use Dart 1.24.3, just uncomment the line and restart terminal.
Thank you for your post, it was my starting point for the same issue.
@melvinabundo That works.
I'm going to close this issue since it's really not a problem with Dart, but with how homebrew works. Homebrew's switch
command will switch between versions in the Cellar/dart/
directory but doesn't support replacing the symlinks with the proper paths pointing to dart@1
. I think I worked around this in the past by going into the Homebrew repository on my local machine and reverting it back to a commit hash where Dart 1 was still the latest version.
I think anyone using Dart 1 will end up downloading the SDK manually anyway.
Switch to Dart 1
brew unlink dart
brew link -f dart@1
Switch to Dart 2
brew unlink dart@1
brew link dart
or
brew link --overwrite dart
--overwrite
only seems to work when switching from 1 to 2
I'm trying to install Dart 1 using homebrew using the new dart@1 formula: https://github.com/dart-lang/homebrew-dart/pull/53
When I run the search command I can see the new formula:
When I run the install command, it installs the formula in a separate directory in the Cellar/ directory:
So this doesn't seem very useful AFAICT. I normally run
brew switch
to switch between new and old versions of homebrew packages (which sets up all of the symlinks for you)Copying the contents of dart@1/1.24.3 into dart/1.24.3 doesn't work completely (pub and other commands don't work quite right)
How do we use these new formula?