title: process failed with exit code 1
body: <p>I'm trying to run "nightmare" script, for screen shots using the following code:
  "usr.dir" contain the path until the "\src\...."</p>
  
  <pre><code>String root = System.getProperty("usr.dir");
  String screenshotJS = "node " + root + "\\src\\main\\resources\\screenshot.js";
  try {
  
    File tempFile = File.createTempFile(root, ".png");
  
    Process p = Runtime.getRuntime().exec(screenshotJS + " " + url + " " + tempFile.toString());
  
    p.waitFor();
  
    int exitCode = p.exitValue();
    if (exitCode != 0) {
      System.out.println("Error Execute when exitCode=1");
    }else{
      System.out.println("Fine Execute when exitCode=0");
      }
  
    BufferedImage bufferedImage = new BufferedImage(
            500, 500, BufferedImage.TYPE_INT_RGB );
    File outputfile = new File(tempFile.getName());
    ImageIO.write(bufferedImage, "png", outputfile);
    return tempFile.getName();
  </code></pre>
  
  <p>The nightmare script:</p>
  
  <pre><code>    const nightmare = require('nightmare')();
      nightmare
     .goto(process.argv[2])
     .viewport(1152, 864)
     .screenshot(process.argv[3] || 'screenshot.png')
     .end(() =&gt; {});
  </code></pre>
  
  <p>The return value of the process is 1.
  What I'm doing wrong ? can someone please assist me with this case?</p>
  
  <p>Thanks,</p>
  
  <p>Ido</p>