4

I tried to follow Get Stated here https://flutter.io/setup-windows/

And got

>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.

How to fix?

Dims
  • 47,675
  • 117
  • 331
  • 600

6 Answers6

11

You are not in the current working directory. Change the directory to your project directory and then run >>flutter run so that it could find pubspec.yaml.

8
  • Download the zip file (Assuming you have already done this)
  • Extract this zip to a safe place say "E://flutter/"
  • Open CMD and goto your workspace folder where to usually create your projects.
  • Run command flutter create <project_name>
  • cd <project_name>
  • Run command flutter run

Alternatively, you can always use a good IDE like Intellij or Android Studio which will automate such configs like @Rechard said.

Arnold Parge
  • 6,684
  • 2
  • 30
  • 34
2

If you are trying to run any command in terminal and getting error of pubspec.ymal not found then Close that session of terminal that you are currently using and open a new one...

Muhammad Umair Saqib
  • 1,287
  • 1
  • 9
  • 20
1

I've also faced with this problem recently. I researched it a little bit and actually there is no particular solution for that problem.

But the way I solved it was:

1) Forget about the file which gives the error.

2) Create a new one like how you've created before.

3) After that call the flutter run thing again. It should work as it worked for me.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
0

For me i just went to the terminal, cd to the directory where you want to get the dependencies and just run 'flutter pub get'.

0

Try pressing Ctrl+Shift+T to open new session.

Pang
  • 9,564
  • 146
  • 81
  • 122
jimi-del
  • 93
  • 1
  • 11