I'm trying to get data from python script at Node.js server. I need to launch this python script with superuser privileges.
child.execFile('sudo python /home/pi/node.js_scripts/app/request.py', function (err, stdout, stderr) {
if (err) throw err;
if (stderr) throw err;
console.log(stdout); });
But i get this error:
Error: spawn sudo python /home/pi/node.js_scripts/app/request.py ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)
How can I solve my problem?