dart-archive / www.dartlang.org

DEPRECATED - OLD SITE for DART
Other
196 stars 149 forks source link

Write Command-Line Apps tutorial does not work on Windows, can't find packages #1579

Closed gazialankus closed 8 years ago

gazialankus commented 8 years ago

This tutorial: https://www.dartlang.org/docs/tutorials/cmdline/

Won't work on Windows:

C:\Development\Dartish\tmp>dir
 Volume in drive C is HDD
 Volume Serial Number is DC07-D177

 Directory of C:\Development\Dartish\tmp

06/01/2016  03:28 PM    <DIR>          .
06/01/2016  03:28 PM    <DIR>          ..
06/01/2016  03:33 PM             2,063 dcat.dart
               1 File(s)          2,063 bytes
               2 Dir(s)  74,771,554,304 bytes free

C:\Development\Dartish\tmp>dart dcat.dart -n quotes.txt
Unhandled exception:
Could not import "package:args/args.dart" from "file:///C:/Development/Dartish/tmp/dcat.dart": Could not resolve a package location for base at file:///C:/Development/Dartish/tmp/dcat.dart
#0      _asyncLoadErrorCallback (dart:_builtin:162)
#1      _asyncLoadError (dart:_builtin:584)
#2      _loadPackage (dart:_builtin:625)
#3      _loadPackage.<anonymous closure> (dart:_builtin:641)
#4      _handlePackagesReply (dart:_builtin:482)
#5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)

C:\Development\Dartish\tmp>

I also started a stackoverflow question about it: http://stackoverflow.com/questions/37568953/dart-command-line-app-on-windows-cant-import-packages

zoechi commented 8 years ago

A simple self-contained command line script might work without pubspec.yaml and without conforming to the pub package layout conventions but when packages (like args in the tutorial) AFAIK this can't work anymore. The tutorial should explain that or at least point to pages that do.

Sfshaza commented 8 years ago

This issue was moved to dart-lang/site-www#39