我有一个Flutter项目Android & IOS。今天,我启动了我的笔记本电脑,在很长一段时间后,尝试升级我的项目依赖,并添加Null安全。
pubspec.yaml
sdk: ">=2.19.0 < 3.0.0"
我使用的是MAC OS,我的项目位于我在/Volumes/Data/Projects/myproject中创建的分区中。当我尝试运行dart migrate命令时,收到以下消息。
Could not find a command named "migrate".
Usage: dart <command|dart-file> [arguments]
Global options:
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable analytics.
--disable-analytics Disable analytics.
--suppress-analytics Disallow analytics for this `dart *` run without changing the analytics configuration.
-h, --help Print this usage information.
Available commands:
analyze Analyze Dart code in a directory.
compilation-server Control the resident frontend compiler.
compile Compile Dart to various formats.
create Create a new Dart project.
devtools Open DevTools (optionally connecting to an existing application).
doc Generate API documentation for Dart projects.
fix Apply automated fixes to Dart source code.
format Idiomatically format Dart source code.
info Show diagnostic information about the installed tooling.
language-server Start Dart's analysis server.
pub Work with packages.
run Run a Dart program.
test Run tests for a project.
我注意到可用命令列表中没有migrate命令。我可以从该文件夹运行其他命令,如dart fix、dart analyze等。
现在我必须手动迁移所有文件。如果我能运行一个迁移工具,那对我来说会更容易和更快。
谢谢你的时间!
1条答案
按热度按时间ql3eal8s1#
在pubspec.yaml中,将sdk替换为
2.19已经是最新的了。