I want to run a command in command-prompt using nodejs.
Based on https://dzone.com/articles/understanding-execfile-spawn-exec-and-fork-in-node, i used
child_process.execFile('protractor', ['./src/convertedJs/tempProtractorconfig.js'], (err, stdout, stderr) => {}
The above code throws a ENOENT error.
But when i run
child_process.exec('protractor ./src/convertedJs/tempProtractorconfig.js', (err,stdout,stderr) => {}`
everything works fine.
Can somebody explain what is happening?