I have .env file at root folder file
NODE_ENV=development NODE_HOST=localhost NODE_PORT=4000 NODE_HTTPS=false DB_HOST=localhost DB_USERNAME=user DB
This solved the issue for me:
const path = require('path'); require('dotenv').config({ path: path.resolve('config.env'), });