I am trying to run an external application in node.js with a child process like the following
var cp = require("child_process"); cp.exec("cd "+path+" && ./run.sh",function(error,stdout,stderr){ })
However, when I try to run it stuck without entering a callback
run.sh starts the server when I execute it using cp.exec. I expect it to start asynchronously, so my application does not wait for the server to finish. In the callback, I want to work with the server.
Please help me solve this problem.
source share