Dart pub is not downloading dependencies - dart

I had moved my Dart Project to another folder, with the same folder structure, however, now, I'm receiving the following message:
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Could not find package "dartflash 0.6.3" at http://pub.dartlang.org.
Here is my pubspec.yaml:
name: Chronium
description: A framework for doing Chrono like games.
dependencies:
dartflash: 0.6.3
And pubspec.lock:
{"packages":{"dartflash":{"version":"0.6.3","source":"hosted","description":"dartflash"}}}
And the file structure:
The website (http://pub.dartlang.org/) is accessible from the browser.
I'm on dart (Dart Editor version 0.2.9_r16323). Do someone knows what is happening?

According to Seth Ladd post, this should be fixed now :
If you were having troubles with pub.dartlang.org, we're happy to report that we've fixed the issue. Many apologies for the temporary downtime. Looks like it was an issue with the server pointing to the wrong data store. Thanks for all the reports, the pub is open again!

Related

Pub does not download dependencies on Windows 7 after the update to lib v2 (SDK 0.3.1_r17328)

After the update to the version 0.3.1_r17328 of Dart SDK and Dart Editor I have some trouble to import some library particulary Args library. I have the same problem both directly importing Args or importing Web_ui where Args is one of the dependencies.
Here is my pubspec.yaml:
name: notes
description: A sample application
dependencies:
web_ui: 0.3.0+1
or:
name: notes
description: A sample application
dependencies:
args: 0.3.1+1
Here is the error generate from build.dart
Unable to open file: C:/Users/Fabio/Dropbox/progetti/note/packages/args/args.dart'package:web_ui/component_build.dart': Error: line 25 pos 1: library handler failed
import 'package:args/args.dart';
'file:///C:/Users/Fabio/Dropbox/progetti/note/build.dart': Error: line 1 pos 1: library handler failed
import 'package:web_ui/component_build.dart';
I solved the problem. It seems that the Cache folder (Pub) has been corrupted.
I have deleted the folder Cache: C:\Users\<UserName>\AppData\Roaming\Pub
Then i run pub install from command line and it works.
Unfortunately, I was getting the same error with my windows XP machine.
In the end, I logged into my windows 7 machine and was able to
download the packages, zipped them up and pasted the libraries into my
windows XP dart editor. Success!
I had no reason to believe I had the exact proxy issue #shindokaku had as I am using my home computer.
I tried all the suggestions on deleting the .cache files, pub.lock files and the packages folder and retrying. I uninstalled dart editor and tried again. I also tried using the git resources to download web-ui and running commands through the command line to no avail
Including suggestions in this similar questions:
cannot-find-referenced-source-packages
is-there-a-workaround-for-pub-dependency-resolution-through-proxies
This problem has been haunting me over and over for a few weeks. I am not using Windows, so this answer is not intended to help the original poster who is using Windows 7.
If you are using Linux here are the steps I use to repair corrupted pub cache.
Go to the top level directory of your app. You should see at least pubspec.lock, pubspec.yaml, a folder named packages, and a folder named web.
Delete your pubspec.lock, and packages folder.
[Make sure you aren't storing your own libraries in the packages folder]
cd ~/dart/myApp/
rm -r packages
rm pubspec.lock
Now once you have removed these files:
pub cache repair
Note 1: if your dart-sdk is not in your systems $PATH, than you will want to use the absolute path to the sdk when using the above command. Comment if you need that explained.
Note 2: This is working solution with Dart 1.5.3. I have not tested this on earlier versions.
Try deleting your pubspec.lock file and packages directory in the root folder of the project. Then run pub install again, when things get wacky thats what I do.
You should try to run pub update. I have sometimes found that this doesn't work as expected from the editor, but generally works quite smoothly when called from the command line.

Why is dart pub suddenly trying to install packages in my css folder?

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?
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!

Is there a workaround for pub dependency resolution through proxies?

I'm trying to play with https://github.com/dart-lang/web-ui-code-lab for dart development. If I follow the pdf and open step05, then try to run chat_server.dart, I get this error (my path has no spaces in it, in case that's relevant):
dart --enable-checked-mode bin/chat_server.dart
Unable to open file: path/to/web-ui-code-lab-master/step05/bin/packages/dart_chat/file_logger.dart'file:///path/to/dart/web-ui-code-lab-master/step05/bin/chat_server.dart': Error: line 5 pos 1: library handler failed
import 'package:dart_chat/file_logger.dart' as log;
^
I presume this means that there are some missing dependencies, but I can't run pub install because I'm behind a corporate http proxy:
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Timed out trying to find package "web_ui 0.2.8+6" at http://pub.dartlang.org.
Hence, I started looking for a temporary workaround for pub dependency resolution. I tried changing the pubspec.yaml to go through the git:// protocol instead of http (which won't resolve without going through the proxy):
name: dart_chat
description: This is a chat app written in Dart using the Dart Web UI package
dependencies:
web_ui:
git: git://github.com/dart-lang/web-ui.git
I get further than before with pub install, so I think it successfully went through the git protocol and is trying to resolve web_ui's dependencies, but unfortunately doing so fails on web_ui's dependency for logging (which looks like it's still going through http://):
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Timed out trying to find package "logging 0.2.7" at http://pub.dartlang.org.
It looks like I can't change the yaml to use the sdk's logging dependency either:
logging:
sdk: logging
because that's an incompatible source with web_ui:
Pub install failed, [1] Resolving dependencies...
Incompatible dependencies on 'logging':
- 'dart_chat' depends on it from source 'sdk'
- 'web_ui' depends on it from source 'hosted'
Is there any other way to get around this proxy issue with the current dev tools? Could I mirror pub.dartlang.org somehow? Or mirror the git repositories for each dependency? Thanks.
You said that you're using a Mac. If it's a laptop, why don't you try doing it from home? I'll notify the author of pub about this issue to see if he has any suggestions.
Currently there is no way to set a proxy in the Dart Editor, you can star this issue to check when it will be available.
I found a workaround to run the Pub install/update behind a proxy: in Windows, you can acess the "Environment variables" and add a variable named HTTP_PROXY with the value
https://USER:PASSWORD#my.proxy.adress:PORT

Pub install stalls on "running pub install" dialog

I'm running pub install so I can use the intl package (I need to use the DateFormat class) that's part of the dart sdk. I've installed other packages into my project such as the XML parser and presentation (similar to impress js). I had no trouble running pub install in the past when I installed the packages that are currently included in my project, but today it just sits in the "running pub install" dialog. I took the intl package declaration out of the yaml file and attempted to update, but it would still hang. I don't get an error message or any indication that the request to install the package is actually being processed.
So, I'm asking whether or not there is a known issue with the pub install feature? What can I do in the meantime?
Here's my yaml code:
name: test_client
description: A sample application
dependencies:
xml:
git: https://github.com/prujohn/dart-xml.git
presentation:
git: https://github.com/CatalystItLabs/presentation.dart
intl:
sdk: intl
Please note that the xml and presentation packages are installed. I reached out to the dartlang community via twitter, but I haven't yet received a response.
Try using git read-only version
dependencies:
xml:
git: git://github.com/prujohn/dart-xml.git
i try https before doesn't work but this work
I've filed a bug http://code.google.com/p/dart/issues/detail?id=6843 about analogous problem.
Feel free to star it to stay tuned for news about possible fixes.

pubspec.yaml deprecated layout

Here is my pubspec.yaml.
name: oct
version: 0.1.0
description: >
Ojus Chemistry Toolkit (OCT) is an open-source toolkit for solving a
variety of cheminformatics problems. It is developed in Dart, mostly.
dependencies:
args:
sdk: args
When I run pub install, I receive a warning as follows.
Warning: Package "oct" is using a deprecated layout.
Reading pub's package layout details, I have not yet understood what is triggering the above warning. Request help! Thanks!
Most likely, you have some .dart files outside predefined directories:
lib
web
test
New SDK gives a helpful link if this problem occurs: http://www.dartlang.org/docs/pub-package-manager/package-layout.html
Lesiak is mostly right. You'll get this warning if pub finds any .dart files in your package's root directory. In the old layout, that was where you put your publicly importable files.
In the new layout, those should go under lib.

Resources