I wanted to experiment with Dart. I had installed Flutter and the Dart installation instructions said that if you had Flutter installed, you don’t need to install Dart separately.
My computer couldn’t find the
dart command though:
$ dart zsh: command not found: dart
flutter doctor -v showed that Dart is installed:
Eventually, I found it
$ ~/snap/flutter/common/flutter/bin/dart --version Dart SDK version: 2.9.0-21.10.beta (beta) (Tue Jul 21 10:46:30 2020 +0200) on "linux_x64"
To fix it, I added a symlink to my
~/bin directory which is on my path:
$ cd ~/bin $ ln -s ~/snap/flutter/common/flutter/bin/dart .
Now it works:
$ dart --version Dart SDK version: 2.9.0-21.10.beta (beta) (Tue Jul 21 10:46:30 2020 +0200) on "linux_x64"
I’m posting this here, because I couldn’t find an answer online, so maybe someone will find this page in a search engine.
Edit: to find the
$ ~/flutter/bin/cache/dart-sdk/bin/pub --version
I fixed it the same way:
$ cd ~/bin $ ln -s ~/flutter/bin/cache/dart-sdk/bin/pub .
After that I was able to download stagehand:
$ pub global activate stagehand
Be sure to read the output from that command, because it has instructions for putting
stagehand on the path:
Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path. You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.): export PATH="$PATH":"$HOME/.pub-cache/bin"
dart2native is in
I don’t know if everything works yet, but that might help people get at least part of the way there. Leave a comment below if you know a better method.