Imprimer à partir de l'électron de l'application

Je suis en train d'utiliser le nœud de l'imprimante d'un électron de l'application, mais dès que j'ai ajouter les lignes d'utiliser l'imprimante, l'application se bloque vers le bas.

La console de sorties ce:

[1] 9860 segmentation fault (core dumped) node_modules/electron-prebuilt/dist/electron.

C'est l'application que je suis en cours d'exécution. J'ai seulement ajouté les lignes d'impression à la simple application exemple fourni sur les électrons de la documentation:

var app = require('app');  //Module to control application life.
var BrowserWindow = require('browser-window');  //Module to create native browser window.
var printer = require('printer');

//Report crashes to our server.
require('crash-reporter').start();

//Keep a global reference of the window object, if you don't, the window will
//be closed automatically when the JavaScript object is GCed.
var mainWindow = null;

//Quit when all windows are closed.
app.on('window-all-closed', function() {
  //On OS X it is common for applications and their menu bar
  //to stay active until the user quits explicitly with Cmd + Q
  if (process.platform != 'darwin') {
    app.quit();
  }
});

//This method will be called when Electron has finished
//initialization and is ready to create browser windows.
app.on('ready', function() {
  //Create the browser window.
  mainWindow = new BrowserWindow({width: 800, height: 600});

  //and load the index.html of the app.
  mainWindow.loadUrl('file://' + __dirname + '/app/index.html');

  //Open the devtools.
  mainWindow.openDevTools();

  printer.printDirect({data:"print from Node.JS buffer" //or simple String: "some text"
      , printer:'HP-Deskjet-F4400-series' //printer name, if missing then will print to default printer
      , type: 'TEXT' //type: RAW, TEXT, PDF, JPEG, .. depends on platform
      , success:function(jobID){
          console.log("sent to printer with ID: "+jobID);
      }
      , error:function(err){console.log(err);}
  });


  //Emitted when the window is closed.
  mainWindow.on('closed', function() {
    //Dereference the window object, usually you would store windows
    //in an array if your app supports multi windows, this is the time
    //when you should delete the corresponding element.
    mainWindow = null;
  });
});

Suis-je raté quelque chose?
J'ai essayé le nœud de l'imprimante sur son propre et j'ai réussi à imprimer certains charabia texte.

OriginalL'auteur leamasuero | 2015-08-28