已失效的 pub 命令和功能

从 Dart 2 开始,pub 不再支持 pub buildpub serve 以及变换器。它们均由 build_runner 工具中的 build system 替代。

As of Dart 2, pub no longer supports pub build, pub serve, or transformers. They’re replaced by the build system, which includes the build_runner tool.

有关在 Dart 2 中构建和提供应用的更多信息请查阅:

For information about building and serving apps in Dart 2, see the following:

获取从 Dart 1 切换到 Dart 2 的帮助请查阅:

For help in switching from Dart 1.x to Dart 2, see the Dart 2 migration guides: