I am trying to execute a command line instruction using node, I want to achieve two things: One which is wait for the process to actually finish before it diverts the user to another page. And the other is to run it successfully (unsurprisingly!).
The alteryx workflow I am running is confirming it is being triggered, but node is telling me I have an error.
if (report=="analyse"){
const { exec } = require("child_process");
var command = '"C:\\Program Files\\Alteryx\\bin\\AlteryxEngineCmd.exe" "C:\\Users\\katherine\\Billing System\\alteryx\\3. analyseV2.yxwz"';
exec(command, (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
};
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
};
callback(stdout);
});