Dart开始 - 无法运行AngularDart Web App模板

时间:2018-05-18 08:59:17

标签: dart angular-dart

我正在尝试按照https://webdev.dartlang.org/guides/get-started

上的说明操作

我在2.0.0-dev.55.0安装了/usr/lib/dart

并在/home/bob/Documents/software/dartium-linux-x64-stable-1.24.2.0/chrome安装了Dartium。

当我尝试 5时。运行应用程序。我得到以下内容:

enter image description here

pubspec.yaml

name: angular_app
description: A web app that uses AngularDart
version: 0.0.1

environment:
  sdk: '>=2.0.0-dev.51.0 <2.0.0'

dependencies:
  angular: ^5.0.0-alpha+12

dev_dependencies:
  angular_test: ^2.0.0-alpha
  build_runner: ^0.8.8
  build_test: ^0.10.2
  build_web_compilers: ^0.4.0
  test: ^0.12.30

我尝试右键单击pubspec.yaml并选择Pub: Get Dependencies,但这没有任何区别。

我还尝试使用https://github.com/angular-examples/quickstart中使用Dart 2而不使用Dartium的示例dart项目。但我仍然得到同样的错误。

当我跑pub run build_runner serve时,我明白了 Could not find bin/build_runner.dart in package build_runner

在WebStorm中构建

当我使用Webstorm构建时,一切看起来都很美好:

Working dir: /home/anton/WebstormProjects/quickstart
/usr/lib/dart/bin/pub global run webdev build --output=web:build
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 675ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 808ms

[INFO] Running build...
[INFO] build_web_compilers|entrypoint on web/main.dart:Running dart2js with --minify --packages=.package-643dc5d58d0e8c6a495fcb24c0476818 -oweb/main.dart.js web/main.dart

[INFO] 1.5s elapsed, 3/4 actions completed.
[INFO] 2.6s elapsed, 3/4 actions completed.
[INFO] 3.7s elapsed, 3/4 actions completed.
[INFO] 4.8s elapsed, 3/4 actions completed.
[INFO] 5.9s elapsed, 3/4 actions completed.
[INFO] 7.0s elapsed, 3/4 actions completed.
[INFO] 8.1s elapsed, 3/4 actions completed.
[INFO] build_web_compilers|entrypoint on web/main.dart:Dart2Js finished with:

Compiled 9,664,399 characters Dart to 162,915 characters JavaScript in 7.72 seconds
Dart file (web/main.dart) compiled to JavaScript: web/main.dart.js

[INFO] Running build completed, took 9.2s

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 271ms

[INFO] Creating merged output dir `build`...
[INFO] Creating merged output dir `build` completed, took 2.9s

[INFO] Writing asset manifest...
[INFO] Writing asset manifest completed, took 3ms

[INFO] Succeeded after 12.3s with 3 outputs (1859 actions)

Process finished with exit code 0

我也尝试过使用https://github.com/dart-lang/angular/tree/master/examples,但仍会遇到同样的错误。

0 个答案:

没有答案