【问题标题】:Error: No pubspec.yaml file found. in MAC错误:未找到 pubspec.yaml 文件。在 MAC
【发布时间】:2023-03-23 23:45:01
【问题描述】:

我是 Flutter 的新手。在 MAC 上安装后,在终端中运行“flutter run”时,出现错误:

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 项目的根目录运行的吗?此目录应包含pubspec.yaml。你检查过那里的文件吗?

标签: terminal flutter


【解决方案1】:

假设您没有创建项目:打开 Android Studio 或您的 IDE 和 create a new flutter project。还要确保您正确设置了环境like in the docs

您尝试运行的此命令flutter run 旨在编译当前目录中的项目,然后在模拟器或设备上运行它。

【讨论】:

    猜你喜欢
    • 2020-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-20
    • 2014-05-13
    • 2015-01-28
    • 1970-01-01
    相关资源
    最近更新 更多