Dustin Dustin - 2 months ago 16
Node.js Question

PM2 - Run Coffeescript file with NodeJS Parameters

I have a NodeJS app written in coffeescript that requires me to set the stack_size parameter in order for it to run correctly. The command looks like this to get it running.

coffee --nodejs --stack_size=65000 app.coffee


Now I'd like to integrate this in to PM2, but can't figure out how to add a parameter like stack_size. How would I go about it?

Answer

There you go:

pm2 start app.coffee --node-args="--max-stack-size=65000"

Documentation

Note that since pm2@2.x you have to first install the coffee support:

pm2 install coffeescript