[英]Nodejs Error: spawn git ENOENT when using simple-git to clone repo
[英]Why do I get a NullReferenceException when using shelljs to clone a git repo?
我试图编写一个相当简单的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但我想我会从中理解发生的事情中受益如何解决输出如此稀疏的情况。
我解决了这个问题 它与我运行的Windows(2.19.1)的git版本有关,并且更新到最新版本会删除错误。
我最终找到了正确的搜索词组合,引导我犯这个错误: https : //github.com/git-for-windows/git/issues/1868
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.