-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in startup using dotenv
module defined in node_args
#2529
Comments
Configure |
@warrenca , how did you solve this issue? In this specific case (using |
I am having same issue? How do we configure cwd entry? |
|
TLDR;
I am having an error with the pm2 starting up the application on server start using
dotenv
module which is defined innode_args
ofecosystem.json5
.Long read...
First of all, I am using the
dotenv
so that i don't need to write all the env config in theecosystem.json5
instead, I'll look for the.env
file. This way, I can git ignore the.env
, which contains sensitive info.I have the following ecosystem content. It works perfectly fine when I just do
pm2 start ecosystem.json5
. Now I am working on starting the server on OS restart. I followed the tutorials for that just fine (i guess so) but when I looked at thepm2 ls
, the server keeps on restarting. then I checked the logs (you can see below), it is looking dotenv moduleError: Cannot find module 'dotenv/config'
. What could be the cause of the this issue and possible solutions.Software versions used
PM2 Log output
Use the command:
tail --lines 100 ~/.pm2/pm2.log
The text was updated successfully, but these errors were encountered: