I am trying to stop a nodejs server started using forever using below code:
func shell(command: String) -> Int32 {
let task = Process()
task.launchPath = "/usr/bin/env"
task.arguments = ["sh", "-c", command]
task.launch()
task.waitUntilExit()
return task.terminationStatus
}
shell(command: "$forever_PATH/forever stop node.js")
I am seeing below error
env: node: No such file or directory
PS:node is located in /usr/local/bin