title: not able to run sails.js app using forever / pm2 in amazon ec2 / digitalocean ubuntu
body: <p>I have installed sails.js (v0.9.16) globally  in amazon-ec2 / digitalocean ubuntu..</p>
  
  <pre><code>sudo npm -g install sails
  </code></pre>
  
  <p>created a test project..</p>
  
  <pre><code>sails new sailstest
  </code></pre>
  
  <p>then lifted the server.. it works fine.. </p>
  
  <pre><code>cd sailstest
  sails lift
  </code></pre>
  
  <p>i can see sails app homepage  on    </p>
  
  <pre><code>http://&lt;domain&gt;:1337/
  </code></pre>
  
  <p>But when i am trying run it using pm2 from app directory,</p>
  
  <pre><code>pm2 start app.js
  </code></pre>
  
  <p>i am getting following error..</p>
  
  <pre><code>Error: Cannot find module 'sails'
  at Function.Module._resolveFilename (module.js:331:15)
  at Function.Module._load (module.js:273:25)
  at Module.require (module.js:357:17)
  at require (module.js:373:17)
  at Object.&lt;anonymous&gt; (/var/www/authenticator/sailstest/app.js:2:1)
  at Module._compile (module.js:449:26)
  at Object.Module._extensions..js (module.js:467:10)
  at Module.load (/usr/lib/node_modules/pm2/node_modules/coffee-script/lib/coffee-script/r$
  at Function.Module._load (module.js:305:12)
  at Module.require (module.js:357:17)
  at require (module.js:373:17)
  at /usr/lib/node_modules/pm2/lib/ProcessContainer.js:151:5
  at WriteStream.&lt;anonymous&gt; (/usr/lib/node_modules/pm2/lib/ProcessContainer.js:104:9)
  at WriteStream.EventEmitter.emit (events.js:107:17)
  at WriteStream.&lt;anonymous&gt; (fs.js:1668:10)
  at Object.oncomplete (fs.js:97:15)
  </code></pre>
  
  <p>I tried running using forever as well..</p>
  
  <pre><code>forever start app.js
  </code></pre>
  
  <p>getting below error..</p>
  
  <pre><code>module.js:333
  throw err;
        ^
  Error: Cannot find module 'sails'
  at Function.Module._resolveFilename (module.js:331:15)
  at Function.Module._load (module.js:273:25)
  at Module.require (module.js:357:17)
  at require (module.js:373:17)
  at Object.&lt;anonymous&gt; (/var/www/authenticator/sailstest/app.js:2:1)
  at Module._compile (module.js:449:26)
  at Object.Module._extensions..js (module.js:467:10)
  at Module.load (module.js:349:32)
  at Function.Module._load (module.js:305:12)
  at Function.Module.runMain (module.js:490:10)
  error: Forever detected script exited with code: 1
  /usr/lib/node_modules/forever/node_modules/forever-monitor/node_modules/broadway/node_modu$
  throw arguments[1]; // Unhandled 'error' event
                       ^
  Error: Cannot stop process that is not running.
  at /usr/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/moni$
  at process._tickCallback (node.js:343:11)
  </code></pre>
  
  <p>Any idea what is wrong?</p>