dart error - could not start pub serve or connect to pub

穿精又带淫゛_ 提交于 2019-12-24 10:35:31

问题


I'm trying to run this drag and drop API. When I try to run the dart file (with the dart editor) I get the following error:

could not start pub serve or connect to pub.

I'm not very familiar with dart. Where's my error?


回答1:


Either you have another service listening on port 8080 (there is an open issue to make the port pub serve is using configurable) or there is already a pub serve instance running (I had this occassionally, that pub serve kept running after DartEditor crashed).

If it is the later, end DartEditor and check in the TaskManger (Windows) if any Dart process is still running and kill all if any, and then start DartEditor and try again.




回答2:


Make sure you're trying to run the correct file. When running any file from the lib/ subdirectory, for example, pub will refuse to serve and — unfortunately — Dart Editor chooses to show the cryptic "could not start pub serve or connect to pub" message.

Click on the little black down arrow (▼) next to the green Run icon and make sure you're not running something other than you want.

(Dart Editor defaults to running the last Dart file you tried to run unless you specify otherwise.)



来源:https://stackoverflow.com/questions/24595732/dart-error-could-not-start-pub-serve-or-connect-to-pub

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!