Dims
Dims

Reputation: 51229

Error: No pubspec.yaml file found when running flutter for the first time

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?

Upvotes: 5

Views: 33896

Answers (6)

Muhammad Umair Saqib
Muhammad Umair Saqib

Reputation: 1865

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

Upvotes: 2

jimi-del
jimi-del

Reputation: 133

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

Upvotes: 0

Garen Johnson
Garen Johnson

Reputation: 1

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

Upvotes: 0

Prakash Chaudhary
Prakash Chaudhary

Reputation: 131

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.

Upvotes: 12

user11595769
user11595769

Reputation:

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.

Upvotes: 1

Arnold Parge
Arnold Parge

Reputation: 6867

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

Upvotes: 8

Related Questions