FlutterError:No pubspec.yaml file found

No pubspec.yaml file found 错误

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.

这个错误出现是在通过flutter run命令运行时候报的错,从报错的信息可以看出来错误原因是找不到pubspec.yaml文件,并且下面也提示的很清楚:此命令应从Flutter项目的根目录运行。

首先怀疑是我的配置不对,检查了一下也没问题
在这里插入图片描述
flutter doctor命令打印的结果并没有问题,后来发现是终端执行命令的位置不对> D:\Flutter\flutterProject\flutterTest>,并没有在项目的根目录执行flutter run命令。这样就找到了问题出在哪里
执行cd flutter项目名成功解决
在这里插入图片描述

发布了24 篇原创文章 · 获赞 5 · 访问量 3943

猜你喜欢

转载自blog.csdn.net/qq_41345281/article/details/102486587