title: Execute command using shelljs in nwjs?
body: <p>I'm trying to execute a simple command using shelljs in nwjs like this :</p>
  
  <p>main.js :</p>
  
  <pre><code>var shell = require("shelljs");
  var output = shell.exec("bash ./test.sh",{silent:true,async:false}).output;
  console.log(output);
  </code></pre>
  
  <p>test.sh :</p>
  
  <pre><code>echo "Hey there"
  </code></pre>
  
  <p>When I run the above file in nodejs like this</p>
  
  <pre><code>node main.js
  </code></pre>
  
  <p>It works without any problems. But when I try to run the above code using nwjs(assuming we have the basic project structure setup with the index.html and main.js), it gives me an error.</p>
  
  <pre><code>[23874:1031/211359:INFO:CONSOLE(191)] ""shell.js: internal error"", source: node_modules/shelljs/src/common.js (191)
  [23874:1031/211359:INFO:CONSOLE(192)] ""Error: ENOENT: no such file or directory, open '/tmp/shelljs_b656f0ddaa7c3b096e97'\n    at Error (native)\n    at Object.fs.openSync (fs.js:540:18)\n    at Object.fs.readFileSync (fs.js:392:15)\n    at execSync (node_modules/shelljs/src/exec.js:109:24)\n    at Object._exec (node_modules/shelljs/src/exec.js:214:12)\n    at Object.exec (node_modules/shelljs/src/common.js:182:23)\n    at file://main.js:33:16"", source: node_modules/shelljs/src/common.js (192)
  </code></pre>
  
  <p>I just want to know if there is any work around or solution to execute the code. Help is appreciated.</p>
  
  <p>Thank you.</p>