title: Issue with PM2 and DotEnv not working on ubuntu server
body: <p>I know that there are answers for this question, but I don't want to create one more config file and load all the configuration there and run the pm2 process.</p>
  
  <pre><code>Project Structure
  -----------------
  .env
  index.js -&gt; server is listening in this file
  routes/
  models/
  middleware/
  startup/
  package.json
  ...
  </code></pre>
  
  <p>Inside <strong>package.json</strong> </p>
  
  <pre><code>{
    "name": "eventbooking",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "start": "node -r dotenv/config index.js"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
      "@hapi/joi": "^15.0.3",
      "bcryptjs": "^2.4.3",
      "compression": "^1.7.4",
      "dotenv": "^8.0.0",
      "express": "^4.17.1",
      "express-async-errors": "^3.1.1",
      "helmet": "^3.18.0",
      "joi-objectid": "^2.0.0",
      "jsonwebtoken": "^8.5.1",
      "mongoose": "^5.5.14",
      "winston": "^3.2.1"
    }
  }
  </code></pre>
  
  <p>As you see from my <strong>package.json</strong> file that I am loading the <strong>node -r dotenv/config index.js</strong> file from <strong>scripts > start</strong></p>
  
  <p>When I run locally with the following command</p>
  
  <p><strong>npm start</strong></p>
  
  <p>The project works totally fine.</p>
  
  <p>Now I have deployed the project to the server and there if I manually run </p>
  
  <p><strong>npm start</strong></p>
  
  <p>then works fine.</p>
  
  <p>When I install <strong>PM2</strong> in Ubuntu Server in production and do the following steps then it's not working.</p>
  
  <p>Step 1: Mode inside the project folder in the root directory and</p>
  
  <pre><code>pm2 start index.js --name "Event Booking"
  </code></pre>
  
  <p>Then getting the following</p>
  
  <pre><code> App name │ id │ version │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem      │ user │ watching │
  ├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼──────────┼──────┼──────────┤ 
  
  │ index    │ 0  │ 1.0.0   │ fork │ 29897 │ online │ 0       │ 0s     │ 0%  │ 3.7 MB   │ root │ disabled 
  </code></pre>
  
  <p>But the project not working. Whats the issue.</p>
  
  <p>Even when I run the following as</p>
  
  <pre><code>pm2 start -r dotenv/config index.js --name 'Event Booking'
  </code></pre>
  
  <p>Then getting error as </p>
  
  <p><strong>error: unknown option `-r'</strong></p>
  
  <p>Any other solution to run the script with pm2</p>