bash: terminal: command not found
<p>I am trying to write a Node.js script that will start a Node.js server in a new process, in a new command window.</p>

<p>I believe I am close. I have this:</p>

<pre><code>var n = cp.spawn('sh', [ 'start-server.sh' ]);
</code></pre>

<p>the contents of start-server.sh are like so</p>

<pre><code>#!/usr/bin/env bash
node bin/www
</code></pre>

<p>this starts the server successfully, but it doesn't open a new terminal window, so I can't see any of the stdio of the spawned process.</p>

<p>So I am thinking that I should open a new terminal window in the bash script and then run the node command, so then the bash script contents would become</p>

<pre><code>#!/usr/bin/env bash
terminal -e "node bin/www"
</code></pre>

<p>the problem is that "terminal" is not recognized at the command line. Why is that? I believe the "terminal" command should default to whatever program is being used as your default terminal application.</p>

<p>Please advise if this is the best way to do this and why "terminal" might not be recognized at the command line in OSX, thanks!</p>

<p>this is what is in my path</p>

<pre><code>echo $PATH
</code></pre>

<blockquote>
  <p>/Users/amills001c/.rvm/gems/ruby-2.2.1/bin:/Users/amills001c/.rvm/gems/ruby-2.2.1@global/bin:/Users/amills001c/.rvm/rubies/ruby-2.2.1/bin:/Users/amills001c/google_app_engine_stuff/google-cloud-sdk/bin:/usr/local/bin:/usr/local/bin/meteor:/usr/local/redis/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/amills001c/golang/bin:/Users/amills001c/apache-maven-3.3.3/bin:/Users/amills001c/.rvm/bin</p>
</blockquote>