I am trying to execute a script shell with node.js .I am Using a child process but when I execute the .js file the script shell is not bee executed . What's wrong with this function?
const { exec } = require('child_process');
exec('/home/nadhem/TradeFinance/Backend/SmartContract/approveLOC.sh',
(err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
return;
}
// the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
});
shelljs(npmjs.com/package/shelljs)