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.

4
  • 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 Commented Jan 2, 2019 at 21:00
  • 1
    I didn't put my actual bitbucket hostname in the code sample, for probably-obvious reasons. :) Commented Jan 3, 2019 at 16:46
  • 1
    I think the comment of @Meg is one of the bests I've seen here ^^ Commented Jan 4, 2019 at 13:47
  • I was just pointing out I didn't get the error, thought it may have happened before the obvious not found. Commented Jan 4, 2019 at 22:41

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.