-
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
interpreter ignored when using cluster mode #1575
Comments
Hello, Yes in fork mode you can defined the interpreter but in cluster mode it's not possible as we rely on the current Node.js version that runs PM2 to use the cluster module (https://github.com/Unitech/PM2/blob/master/lib/God/ClusterMode.js#L50) |
Hmm, yes of course, that makes sense. A real pity though. |
Suggest documention it(in npm --help output or some where else), i waste many time to investigate the same problem:( |
I stumbled on this as well @Unitech I would like to be able to overwrite the Basically i want to prefix whatever Any way to achieve this? Would like to not write the update i have a hack work-around to modify
but would be nice if i could do this from pm2 :) |
@jippi PM2 has a hardcoded binary name (which is 'node') for start in cluster mode since we are using the cluster mode of nodejs. By the way you can inject custom env values into your app using PM2 (cf. http://pm2.keymetrics.io/docs/usage/application-declaration/) |
@vmarchaud sure, but being able to wrap the Having the environment variables in a static file is not an optimal requirement/pattern for docker and highly flexible environments where these things change quite rapidly and can come from multiple sources. |
@jippi Understood but other people might try to use another interpreter in cluster mode and since its wont work, tell us that its our responsibility to verify that the interpreter is node, so yeah, not an easy choice here. |
@vmarchaud would it make sense to have a new config key for this ? e.g. Would also allow me to mix nodejs versions easily under the same pm2 instance :) |
I think you can already do this by using |
My working workaround is to do:
|
This works as expected:
pm2 start app -i 2
pm2 start app --interpreter=/usr/local/n/versions/node/0.12.0/bin/node
But when combined the interpreter argument is ignored:
pm2 start app -i 2 --interpreter=/usr/local/n/versions/node/0.12.0/bin/node
The same applies when declared in a json file
The text was updated successfully, but these errors were encountered: