'pub get'给Angular2包带来错误

时间:2016-04-15 09:16:11

标签: dart angular

我有一个'pubspec.yaml',内容如下:

# #docregion
name: angular2_tour_of_heroes
version: 0.0.1
environment:
  sdk: '>=1.13.0 <2.0.0'
dependencies:
  angular2: 2.0.0-beta.15
  browser: ^0.10.0
  dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
    platform_directives:
    - package:angular2/common.dart#COMMON_DIRECTIVES
    platform_pipes:
     - package:angular2/common.dart#COMMON_PIPES
    entry_points: web/main.dart

当我在命令行中运行'pub get'时,得到以下错误:

Resolving dependencies... 
Got dependencies!
Precompiling dependencies... 
Loading source assets... 
Loading angular2/transform/codegen, dart_to_js_script_rewriter, observe and smokLoading angular2/transform/codegen, dart_to_js_script_rewriter, observe and smokLoading angular2/transform/codegen, dart_to_js_script_rewriter, observe and smoke/src/default_transformer transformers... 
Transformer library "package:angular2/transform/codegen.dart" not found.

我该如何解决?

创建错误报告:https://github.com/dart-lang/pub/issues/1406

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,花了很多时间来修复它。我的根本原因是在我迁移到新计算机之后。我的hosts文件没有迁移。将127.0.0.1 localhost添加到我的hosts文件后,它就开始工作了。