0

I tried adding the three/three.dart package from their Git repository to my project. I did that as mentioned here. But running pub get from the editor gives the following error:

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.

**

Warning: Application may fail to run since packages did not get installed.Try running pub get again. **

I do have git installed on my system. I run Ubuntu 14.04 if that's relevant.

Edit: I tried pub --trace get and got this:

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

This was followed by a long log message.

Here is pubspec.yaml file:

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

Got it to work finally. I specified the version along with the URL to the Git repo. Here is my final pubspec:

dependencies:
  browser: any
  three:
    git: git://github.com/threeDart/three.dart.git
    version: '>=0.2.5+1 <0.3.0'
user3699912
  • 158
  • 2
  • 3
  • 13
  • I tried the dependency from the linked question (exact copy from the question, not the answer) and it worked for me. Did you try `pub --trace get`? – Günter Zöchbauer Jun 08 '14 at 15:36
  • Please add the output to your question. Comments don't allow to format the text. – Günter Zöchbauer Jun 08 '14 at 18:04
  • Sorry about that. I have added the output. – user3699912 Jun 08 '14 at 18:21
  • Can you please add your pubspec.yaml or at least the part where you define your dependency. Ensure that indentation in the question is exactly the same as in your pubspec.yaml file. Select the text after you added it to the question and press the `{}` button in the toolbar to format it as code. When you scroll down you see a preview where you can verify if it is formatted correctly. Can you please also clone the repo (`git clone git://github.com/threeDart/three.dart.git`) at the command line and add the result to your question too. – Günter Zöchbauer Jun 08 '14 at 18:25
  • Added the dependencies in my pubspec file. I did clone the repository earlier and it downloaded the three.dart folder to my home directory. – user3699912 Jun 08 '14 at 18:38
  • Can it have to do with https://groups.google.com/a/dartlang.org/forum/#!topic/bugs/BEjbHxTL_CM ? – Günter Zöchbauer Jun 09 '14 at 20:30
  • But I am running it on Ubuntu. – user3699912 Jun 11 '14 at 14:54
  • The 'Progress' window in the editor says the repository is not found. Weird. – user3699912 Jun 11 '14 at 17:42
  • Yes, weird, but I'm out of ideas. Can you try to clone it to your local disc and use a path dependency? You could also try to use a git dependency with a path to a local repository. Maybe this leads to new findings? – Günter Zöchbauer Jun 11 '14 at 17:45
  • Good news. I added the git repository as mentioned above and I also specified the version. Bam! it works! – user3699912 Jun 11 '14 at 18:00
  • Glad to hear you got it working! – Günter Zöchbauer Jun 11 '14 at 18:13

1 Answers1

2

I had to specify the version range for the package along with the link to the git repository.

dependencies:
  browser: any
  three:
    git: git://github.com/threeDart/three.dart.git
    version: '>=0.2.5+1 <0.3.0'
user3699912
  • 158
  • 2
  • 3
  • 13