无法从他们的Git存储库添加three.dart包

时间:2014-06-08 15:17:51

标签: dart dart-pub

我尝试将他们的Git存储库中的three / three.dart包添加到我的项目中。我按照here提到的那样做了。但是从编辑器运行pub get会出现以下错误:

Pub get failed, [1] Resolving dependencies... (0.1s)
Git error. Command: git fetch
fatal: Not a git repository (or any of the parent directories): .git
../../../../../../mnt/data/b/build/slave/dart-editor-linux-stable/build/dart/sdk/lib/_internal/pub/lib/src/git.dart 47  run.<fn>
dart:isolate                                                                                                            _RawReceivePortImpl._handleMessage
This is an unexpected error. Please run

    pub --trace 'get'

and include the results in a bug report on http://dartbug.com/new.

** Warning: Application may fail to run since packages did not get installed.Try running pub get again. **
Pub get failed, [1] Resolving dependencies... (0.1s)
Git error. Command: git fetch
fatal: Not a git repository (or any of the parent directories): .git
../../../../../../mnt/data/b/build/slave/dart-editor-linux-stable/build/dart/sdk/lib/_internal/pub/lib/src/git.dart 47  run.<fn>
dart:isolate                                                                                                            _RawReceivePortImpl._handleMessage
This is an unexpected error. Please run

    pub --trace 'get'

and include the results in a bug report on http://dartbug.com/new.

**

警告:应用程序可能无法运行,因为软件包未安装。请尝试再次运行pub。 **

我的系统上安装了git。如果相关,我运行Ubuntu 14.04。

编辑: 我试过pub --trace get并得到了这个:

Resolving dependencies... 
Git error. Command: git fetch
fatal: Not a git repository (or any of the parent directories): .git

之后是一条长日志消息。

这是pubspec.yaml文件:

dependencies:
  browser: any
  three:
    git:
      url: 'git://github.com/threeDart/three.dart.git'

终于有了工作。我指定了版本以及Git仓库的URL。这是我最后的pubspec:

dependencies:
  browser: any
  three:
    git: git://github.com/threeDart/three.dart.git
    version: '>=0.2.5+1 <0.3.0'

1 个答案:

答案 0 :(得分:2)

我必须指定包的版本范围以及指向git存储库的链接。

dependencies:
  browser: any
  three:
    git: git://github.com/threeDart/three.dart.git
    version: '>=0.2.5+1 <0.3.0'