【发布时间】:2019-05-26 15:32:10
【问题描述】:
我正在尝试编写一个相当简单的 nodejs 程序,该程序需要克隆一个 git repo。
var shell = require('shelljs');
shell.exec('git clone http://mybitbuck.et/scm/myproject/myrepo.git');
如下抛出错误,然后似乎一直挂起而不退出:
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
没有额外的输出或堆栈跟踪,甚至没有行号。发生了什么事,我怎样才能让它发挥作用,或者至少获得关于正在发生的事情和原因的更多信息?
我知道我可以使用 nodegit 或类似工具来代替 shell,但我想我会从了解这里发生的事情中受益如何解决输出如此稀疏的情况。
【问题讨论】:
-
我无法在我的机器上重现它。居然得到了
Cloning into 'myrepo'...fatal: unable to access 'http://mybitbuck.et/scm/myproject/myrepo.git/': Could not resolve host: mybitbuck.et -
出于可能显而易见的原因,我没有将我的实际 bitbucket 主机名放入代码示例中。 :)
-
我认为@Meg 的评论是我在这里看到的最好的评论之一^^
-
我只是指出我没有得到错误,以为它可能发生在明显的未找到之前。