Could not find a file named “pubspec.yaml” in

 ̄綄美尐妖づ 提交于 2019-11-27 07:39:53

问题


I'm new with Dart.

I create a simple Web application but when I want to run it I got this message in "Tools Output" :

Could not find a file named"pubspec.yaml"in"/home/reza/.pubcache/hosted/pub.dartlang.org/browser-0.10.0+2".

How can I fix this problem ?

I use Ubuntu 14.04LTS 64bit and DartDditor 1.7.2


回答1:


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).




回答2:


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.



来源:https://stackoverflow.com/questions/27217278/could-not-find-a-file-named-pubspec-yaml-in

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