Node Webkit 程序因 nwdirectory 而崩溃

Node Webkit program crashes with nwdirectory

我正在尝试在我的节点 webkit 程序中创建目录 selection 对话框。

根据 the documentation 我只需要将 nwdirectory 添加到我的文件对话框中。

每次我使用文件对话框时,select输入一个文件夹并单击确定后,我的程序会挂起几秒钟,然后退出且没有任何错误消息。

我也尝试使用 webkit 标志 webkit 目录,结果相同。

我使用 jQuery:

将定位器附加到我的设置 window
settings.append($('<input style="display:none;" id="fileDialog" nwdirectory type="file"/>'));
settings.append($('<span class="saveLoc">'+ options['savelocation'] +'</span>'));

我使用文档中的函数绑定它:

function chooseFile(name) {
  var chooser = $(name);
  chooser.change(function(evt) {
    console.log($(this).val());
  });
  chooser.trigger('click');
}
settings.find('.saveLoc').click(function(){
  chooseFile('#fileDialog');
});

如果我删除 nwdirectory 标志,代码会工作,但用户只能 select 文件,不能文件夹。

我是不是搞错了?如果没有,我有什么办法可以提取有关崩溃原因的信息吗?

谢谢!

解决方案:我使用的是 nw 版本 0.12.0。当我降级到 0.11.6 时它起作用了。