require('dotenv').config('./.env'); Should be: require('dotenv').config({ path: './.env' }); Fatal type error.