Reputation: 51229
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
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
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
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
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
Reputation: 6867
flutter create <project_name>
cd <project_name>
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