I am trying to run a Flutter for web project, which was working just fine, until I ran flutter packages run, after which webdev serve gives the error above. My project is located in a different directory, E:\Flutter_web_try to be specific, which has a pubspec.yaml file.
I have already tried flutter pub pub packages get, reinstalling flutter, deactivating and reactivating webdev but none of those have worked. No new flutter_web project I create is running either, and throws the same error. I have also tried installing a fresh version of Flutter, with the env variables changed, but still the error remained the same.
webdev could not run for this project.
Could not find a file named "pubspec.yaml" in "C:\Users\Sanchit\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\protobuf-0.13.12".```
It should run properly, and tell me the default port at which the project is being served on, which it did before the flutter packages get command.
You're having that issue because your webdev
path is not setup correctly. If you still want to run your web app, go to that path and execute:
flutter packages pub global run webdev serve
Same thing if you want to build your web app to release:
flutter packages pub global run webdev build
be sure to finish your webdev serve
(control + c) before building or is not going to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With