3

I am attempting to write a fairly simple nodejs program that needs to clone a git repo.

var shell = require('shelljs');
shell.exec('git clone http://mybitbuck.et/scm/myproject/myrepo.git');

Throws an error as follows, and then seems to hang without exiting forever:

fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.

There is no additional output or stack trace, not even a line number. What is going on, and how can I get it working, or at least get more information about what is happening and why?

I know I could use nodegit or similar instead of using the shell but I think I would benefit from understanding what is happening here HOW to address situations where output is so sparse.

Meg
  • 938
  • 9
  • 20
  • 2
    I couldn't reproduce this in my machine. Actually got `Cloning into 'myrepo'...` `fatal: unable to access 'http://mybitbuck.et/scm/myproject/myrepo.git/': Could not resolve host: mybitbuck.et` – rlecaro2 Jan 02 '19 at 21:00
  • 1
    I didn't put my actual bitbucket hostname in the code sample, for probably-obvious reasons. :) – Meg Jan 03 '19 at 16:46
  • 1
    I think the comment of @Meg is one of the bests I've seen here ^^ – Alejandro Vales Jan 04 '19 at 13:47
  • I was just pointing out I didn't get the error, thought it may have happened before the obvious not found. – rlecaro2 Jan 04 '19 at 22:41

1 Answers1

3

I solved this. It is related to the version of git for windows (2.19.1) that I was running, and updating to the newest version removed the error.

I eventually found the right search term combination that lead me to this bug: https://github.com/git-for-windows/git/issues/1868

Meg
  • 938
  • 9
  • 20