Note that there are some explanatory texts on larger screens.

plurals
  1. POnode.js Error: ENOSYS spawn when executing command line command
    primarykey
    data
    text
    <p>I'm trying to run node.js under unix, and getting this error dooing that:</p> <pre><code>var exec = require('child_process').exec; var commandLine = "/var/util/generate 300 300 &gt; /tmp/barcode.png"; var childProcess; http.createServer(function (req, res) { var request = url.parse(req.url, true); var action = request.pathname; if (action == '/barcode.png') { console.log('executes commandLine'); // executes 'commandLine' childProcess = exec(commandLine, function (error, stdout, stderr) { sys.print('stdout: ' + stdout); sys.print('stderr: ' + stderr); var img = fs.readFileSync('/tmp/barcode.png'); res.writeHead(200, { 'Content-Type' : 'image/png' }); res.end(img, 'binary'); if (error !== null) { console.log('exec error: ' + error); } }); } else { res.writeHead(200, { 'Content-Type' : 'text/plain' }); res.end('QR Generate service reply: Please provide correct request parameter \n'); } }).listen(8888); </code></pre> <p>console.log("QR Generate service running at <a href="http://localhost:8888" rel="nofollow">http://localhost:8888</a>");</p> <p>But I'm getting:</p> <pre><code>Error: ENOSYS spawn at errnoException (child_process.js:476:11) at ChildProcess.spawn (child_process.js:443:11) at child_process.js:341:9 at Object.execFile (child_process.js:250:15) at child_process.js:217:18 at Server.&lt;anonymous&gt; (/base/usr/node/service.js:139:18) at Server.emit (events.js:70:17) at HTTPParser.onIncoming (http.js:1479:12) at HTTPParser.onHeadersComplete (http.js:102:31) at Socket.ondata (http.js:1375:22) </code></pre> <p>when it hits exec(</p> <p>What is wrong?</p> <p>Version of node is 0.6.4</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload