1 Reply
      Latest reply on Aug 15, 2019 3:24 AM by eskimo
      SyamalaDutt Level 1 Level 1 (0 points)

        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

        • Re: How to run a node from swift
          eskimo Apple Staff Apple Staff (11,625 points)

          I am trying to stop a nodejs server started using forever

          What platform are you working on?

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"