简体   繁体   English

使用shelljs克隆git repo时为什么会出现NullReferenceException?

[英]Why do I get a NullReferenceException when using shelljs to clone a git repo?

I am attempting to write a fairly simple nodejs program that needs to clone a git repo. 我试图编写一个相当简单的nodejs程序,需要克隆一个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. 我知道我可以使用nodegit或类似的而不是使用shell但我想我会从中理解发生的事情中受益如何解决输出如此稀疏的情况。

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. 它与我运行的Windows(2.19.1)的git版本有关,并且更新到最新版本会删除错误。

I eventually found the right search term combination that lead me to this bug: https://github.com/git-for-windows/git/issues/1868 我最终找到了正确的搜索词组合,引导我犯这个错误: https//github.com/git-for-windows/git/issues/1868

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM