2016-07-24 10 views
0

私はちょうどダーツを学び始めました。パッケージ "dart_to_js_script_rewriter"は依存関係ではありません

まず、angle2-dartベースのプロジェクトをhttps://angular.io/docs/dart/latest/quickstart.htmlから作成して、正しく動作させました。

今私はhttps://pub.dartlang.org/packages/auth0_lockからauth0ロックダーツパッケージを追加したいので、私は次のようにpubspec.yamlを変更:

name: go_dart_angular2_zingchart 
description: Go Dart Angular2 with ZingChart Started Kit 
version: 0.0.1 
environment: 
    sdk: '>=1.13.0 <2.0.0' 
dependencies: 
    angular2: ^2.0.0-beta.18 
    browser: ^0.10.0 
    dart_to_js_script_rewriter: ^1.0.1 
    auth0_lock: ^0.1.0 
transformers: 
- angular2: 
    platform_directives: 
    - 'package:angular2/common.dart#COMMON_DIRECTIVES' 
    platform_pipes: 
    - 'package:angular2/common.dart#COMMON_PIPES' 
    entry_points: client/web/main.dart 
- dart_to_js_script_rewriter 

と私はpub getを実行したときに、今、私は次のエラーを取得する:

Error on line 15, column 3 of ../../../.pub-cache/hosted/pub.dartlang.org/auth0_lock-0.1.0/pubspec.yaml: Error loading transformer "dart_to_js_script_rewriter": package "dart_to_js_script_rewriter" is not a dependency. 
- dart_to_js_script_rewriter 
    ^^^^^^^^^^^^^^^^^^^^^^^^^^ 

私は私がやっている全くわからDARTへの新しいじゃないので、..私はこの問題を解決する方法が分からない:)

任意のアイデア?

ありがとうございました!

答えて

2

auth0_lock: ^0.1.0を私の依存関係に追加してpub getを実行すると、同じエラーが発生します。このエラーメッセージは、 "dart_to_js_script_rewriter"がauth0_lockパッケージのpubspec.yamlに依存しないことを示しています。 と表示された場合、dev_dependeciesの下に追加されたようです。依存パッケージのDev dependenciesは無視されます。パブはパッケージのデベロッパー依存限定のみを取得します。

私はこれがパッケージの問題だと思います。

私はhttps://github.com/andresaraujo/auth0_lock.dartに行き、パッケージを複製し、それをauth0_lockというディレクトリに自分のプロジェクトルートに追加しました。そして、私のpubspec.yamlに私が入れ:

auth0_lock: 
    path: auth0_lock 

をその後、私は

import 'package:auth0_lock/auth0_lock.dart'; 
+1

参照を使用して、それをインポートすることができ、またhttps://github.com/dart-lang/pub/issues/1259 。これは 'pub'の制限です。パッケージ自体がビルドされているときのみトランスフォーマーが実行されるようにするための 'dev_transformers'をサポートすることが議論されました。別のパッケージの依存関係としてビルドされたときではありません。変圧器は、例として 'auth0_lock'でのみ使用され、依存関係として使用される場合は無関係です。 –

関連する問題