-
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 using PM2 with node-config when NODE_APP_INSTANCE === 0 #2045
Comments
I'm having the exact same problem and the The problem is that both PM2 and node-config use the same environment variable, but for very different purposes, and neither provide a namespace. In the original thread (#1143) that requested the |
+1 |
Same issue here... #244 is marked as fixed which I think is crap since it smells like a total hack. This bug is sitting open for like 9 months with no motion... Think I am going to write off PM2 and move on. I'll take a look at forever and passenger thanks :-) |
Published under PM2 2.5 : npm install -g pm2@latest && pm2 update |
Here is what i did to address the issue after reading all of the solutions proposed module.exports = {
apps : [
{
name : 'process-name',
script : './app.js',
cwd : '/var/www/<your website name>/',
instance_var: 'INSTANCE_ID',
env: {
"PORT": 3000,
"NODE_ENV": 'development',
"NODE_CONFIG_DIR": "/var/www/<your website name>/config/"
},
env_production : {
"PORT": 8080,
"NODE_ENV": 'production',
"NODE_CONFIG_DIR": "/var/www/<your website name>/config/"
}
}
]
}; 5- $ pm2 start pm2.config.js --env production |
You have a way to avoid this problem with pm2 2.5 (see docs) :
module.exports = {
apps : [
{
name: "myapp",
script: "./app.js",
watch: true,
instance_var: 'INSTANCE_ID',
env: {
"PORT": 3000,
"NODE_ENV": "development"
}
}
]
} |
@vmarchaud I am using v2.6.1 and i can confirm that i don't need an empty default-0.js/json file. |
I had big problems using PM2 today with nginx (reverse proxy):
http://serverfault.com/questions/766280/nginx-proxy-pass-cannot-fetch-assets
This seems to be the issue:
node-config/node-config#244
and not just warning, I cannot run this app with
pm2
at all... is there a way to make this seamlessly work? Does pm2 need a bugfix or it's just not compatible withconfig
package? I tried creating thedefault-0.json
with{}
as described in that thread but it didn't help...This was a hard one to discover that
pm2
is at fault...forever
andpassenger
work in this same case...thank you
The text was updated successfully, but these errors were encountered: