title: I have node.js application I am setting .env using dotenv, I get the following error when using port
body: <p>I have node.js application I have installed dotenv and add the following configuration in my .env file</p>
  
  <pre><code> DB_HOST='localhost'
   DB_Database=TheDatabasename
   DB_USER=TheUser
   DB_PASS=thePassword
   DB_PORT=1433
  </code></pre>
  
  <p>I am using sqlserver I call dotenv like bellow:</p>
  
  <pre><code>const sql = require('mssql');
  const dotenv = require('dotenv');
  dotenv.config();
  
  const config = {
   user: process.env.DB_USER,
   password: process.env.DB_PASS,
   server: process.env.DB_HOST, 
   database: process.env.DB_Database,
   port: process.env.DB_PORT,
  }
  
   const poolPromise = new sql.ConnectionPool(config)
  .connect()
  .then(pool =&gt; {
   console.log('Connected to MSSQL')
   return pool
  })
   .catch(err =&gt; console.log('Database Connection Failed! Bad Config: ', err))
  
   module.exports = {
    sql, poolPromise
   }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>  Database Connection Failed! Bad Config:  TypeError: The "config.options.port" property must be of type number.
  </code></pre>