dotenv file is not loading environment variables November 5, 2022 by Tarik How about use require('dotenv').config({path:__dirname+'/./../../.env'}) ? Your problem seems to be the execution path.