title: How to pass NODE_ENV=production to pm2?
body: <p>I have <a href="https://github.com/FreeFeed/freefeed-server" rel="noreferrer">this node app</a> deployed and runs fine with <code>NODE_ENV=production yarn  start</code>. </p>
  
  <p>I can demonize the app using </p>
  
  <p><code>pm2 start npm -- start</code> </p>
  
  <p>but then it defaults to <code>NODE_ENV=development</code> config.</p>
  
  <p>And when I use</p>
  
  <p><code>pm2 start npm -- start NODE_ENV=production</code> </p>
  
  <p>It still starts with <code>development</code> config. </p>
  
  <p>Also I tried passing the env using a <code>process.yml</code> file</p>
  
  <pre><code>apps:
    - script   : index.js
      watch: true
      instances: 4
      env    :
        NODE_ENV: production
  </code></pre>
  
  <p>but <code>pm2 start npm -- start process.yml</code> still loads the development configs.</p>
  
  <p>How can I fix this? </p>