Could not find a file named "pubspec.yaml" in Could not find a file named "pubspec.yaml" in dart dart

Could not find a file named "pubspec.yaml" in


This has happened to me several times:

What's ultimately solved things for me (OS X) is deleting pub's cache:

sudo rm -Rf /Users/<username>/.pub-cache

Also delete the packages directory in your project's root:

sudo rm -Rf packages

Then pub get again in your project(s), but make sure that you are not operating as root (a whoami will tell you, and an exit will get you out of there).


I looks like your pub cache is corrupted. You can try to run pub cache repair from the command line but I think that this is still not working when the pubspec.yaml file is missing (there was an open issue about this - found it: http://dartbug.com/21418). Please try to delete the folder /home/reza/.pubcache/hosted/pub.dartlang.org/browser-0.10.0+2 and then run pub get from within your project directory or from DartEditor.


run flutter clean and then flutter pub get