In windows we can use
<target name="stopnode" description="Stops all instances of node">
    <exec executable="taskkill">
        <arg value="/IM"/>
        <arg value="node.exe"/>
    </exec>
</target>
in Mac when I use kill -9 process_id
or killall node
based on the SO post Stop node.js program from command line.
It says process not found when I am trying to use the following code to kill the node server
<exec osfamily="unix" executable="killall" failonerror="false" resultproperty="prp.result.kill">
    <arg line="node"/>
</exec>
 
    