"zsh: command not found: pub" 正在测试我的代码以进行锻炼

"zsh: command not found: pub" while testing my code for exercism

我想测试 exercism.io 的编码练习。在 Intellij IDEA 和 Android Studio 上,当我尝试在终端上键入“$ pub get”和“$ pub 运行 test”时。我收到此错误 "zsh: command not found: pub or $"。我在这里堆放了 2 天。我该怎么办?

我的系统:Mac OS Catalina 版本 10.15.3。 我的 Android SDK 位于:Users/vortovor/Developer/flutter/bin/cache

在缓存中有一个名为 "dart-sdk" 的文件。

您可能想要使用您正在使用的 Flutter 版本附带的 pub,如 pub tool section of Dart documentation 中所述:

Flutter note: If you’re using the Flutter SDK, don’t use the pub command directly. Instead use the flutter pub command, (...)

flutter pub get
# or
flutter pub test