BugMedic

Flutter “No pubspec.yaml found”: run from the project root

cd into the directory that contains pubspec.yaml and re-run the command.

By BugMedic editorial teamLast source review: 2026-09-29macOS, Windows, Linux

Run flutter commands from the folder that contains pubspec.yaml — not a subdirectory, not the parent. Check with pwd and ls pubspec.yaml. If no Flutter project exists there, scaffold one with flutter create my_app.

Try these fixes in order

01

Check the current directory

The shell may be sitting in a subfolder like lib/ or android/ instead of the project root.

pwd
02

Confirm pubspec.yaml is present

If the file is missing here, you are in the wrong folder; move up or into the project.

ls pubspec.yaml
03

cd to the project root

Change into the directory that holds pubspec.yaml.

cd ~/development/my_app
04

Re-run the command

With the working directory fixed, the command finds pubspec.yaml and runs normally.

flutter pub get

Interpret what you see

You are in a subdirectory of the project

What it suggests: flutter looks for pubspec.yaml in the current directory only; running from android/, lib/, or the parent folder fails.

Next check: cd to the folder containing pubspec.yaml and re-run.

No pubspec.yaml anywhere nearby

What it suggests: The directory has no Flutter project; perhaps you cloned only a subfolder or opened the wrong checkout.

Next check: Locate the real project root, or run flutter create to scaffold one.

It works in the IDE but not in the terminal

What it suggests: IDEs usually set the working directory correctly, but integrated terminals can start in the workspace root above the project.

Next check: Check pwd in the terminal before running flutter commands.

Why this happens

  • The command was run from a subdirectory or parent directory instead of the project root.
  • The folder is not a Flutter project at all (no pubspec.yaml was ever created there).

Still not working?

Do not create a pubspec.yaml by hand to silence this; a hand-written one misses the flutter: sdk entry and plugin registrants, and later commands fail in stranger ways. Generate it with flutter create or open the real project folder.

Official sources

These steps are based on the linked documentation and general diagnostics. BugMedic has not independently tested every product and system configuration. Review commands before running them.

Related Flutter guides