我尝试将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 get。 **
我的系统上确实安装了git。如果相关,我将运行Ubuntu 14.04。
编辑:
我尝试了pub --trace得到并得到了这个:
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。这是我最后的发布规范:
dependencies:
browser: any
three:
git: git://github.com/threeDart/three.dart.git
version: '>=0.2.5+1 <0.3.0'
最佳答案
我必须指定软件包的版本范围以及git存储库的链接。
dependencies:
browser: any
three:
git: git://github.com/threeDart/three.dart.git
version: '>=0.2.5+1 <0.3.0'
关于dart - 无法从其Git存储库中添加three.dart软件包,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24107584/