2
votes

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.
2
Try using flutter packages pub global run webdev serve in your terminal and tell us the output.Ryk
No active package webdev. pub finished with exit code 65Imperpetual Machine
Try using pub global activate webdev to activate the package.Ryk
Was already active, ran this command, still gives the same errorImperpetual Machine

2 Answers

3
votes

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.

0
votes

Try running this command in your project directory.

pub get

It will install all missing dependencies. In your case protobuf-0.13.12.