Error: No pubspec.yaml file found.的解决办法

mac2023-06-10  29

在执行 flutter clean 指令时提示异常,说找不到pubspec.yaml文件,日志如下:

D:\setup\flutterSDK\flutter>flutter clean Error: No pubspec.yaml file found. This command should be run from the root of your Flutter project. Do not run this command from the root of your git clone of Flutter. D:\setup\flutterSDK\flutter>

原因已经提示的很明确了,主要的原因就是执行命令的路径不对,执行命令时需要保证路径在项目的根目录,即pubspec.yaml文件所在的路径,或者可以新打开一个terminal窗口,如下:

最新回复(0)