Node | PM2 -> can't see .env file for Mysql? Probably because of this

Tony Mucci
Code Kings
Published in
Jun 8, 2024

This is a quick note for myself that I am sharing with everyone. Happy Coding

You are not in the project’s root directory. PM2 for some dumb reason cant see .env files with dotconfig if the pm2 instance is not running inside the project’s root folder.

  • Go to Projects Root
  • Run your PM2 node webserver
  • Once your site is up, go to the browser and try to see if data is coming back from your instance.

--

--

Tony Mucci
Code Kings

Co-founder of SimpliCourt, dree, My Company Tools, and Eklect Enterprises