问题
Running pub update ...
Pub update failed, [1] Resolving dependencies...
DirectoryIOException: Directory listing failed, path = <longpath>/web/css/packages (OS Error: No such file or directory, errno = 2)
Why would pub suddenly try to look for packages in my css folder?
回答1:
The short answer, pub puts symlinks into subdirectories to ensure that you can use package:
in any Dart file in any subdirectory of a "deployable" directory.
Because web
is deployable in the sense that you'll likely take everything in web and throw it up on a web server, pub wants to make it easy for Dart files to work.
There are no conventions right now, so pub takes the optimistic approach because it can't anticipate where you might put Dart files.
Regardless, you shouldn't get an error, so this might be a bug. I just tried it on a brand new sample app with a web/css
and pub install
and pub update
worked for me.
Can you please submit a bug at http://dartbug.com/new with details of your OS and the output of dart --version
? Many thanks!
来源:https://stackoverflow.com/questions/14262638/why-is-dart-pub-suddenly-trying-to-install-packages-in-my-css-folder