title: Run NodeJS application without environment variable
body: <p>I have a node application that I run on a Linux Server (CentOS 6.5) by setting my environment with a bash script</p>
  
  <pre><code>env_nodejs.sh
  
  #!/bin/bash
  
  PATH=$PATH:/opt/nodejs/node-v6.9.4-linux-x64/bin
  export PATH
  </code></pre>
  
  <p>So that I can</p>
  
  <pre><code># . ./env_nodejs.sh
  # node /var/www/html/application/app.js
  </code></pre>
  
  <p>That all works fine but if I do the following in a separate script</p>
  
  <pre><code>run_app.sh
  
  #!/bin/bash
  
  $COMMAND=/opt/nodejs/node-v6.9.4-linux-x64/bin/node
  $SITE=/var/www/html/application/app.js
  
  nohup $COMMAND $SITE &gt; /tmp/nodeapp.log &amp;
  </code></pre>
  
  <p>This runs the node server and app but with errors that seem to be related to npm</p>
  
  <pre><code>Error: Failed to lookup view "control/users" in views directory "/views"
  </code></pre>
  
  <p>I have a feeling this is because the environment is not set but is there a way to run it correctly without the environment or to pass additional parameters for the npm location?</p>