I use chalk to styling my console, but with pm2 it doesn't work
my code is like this:
console.log(chalk.green('this is a chalk color string'));
run it with node or pm2 command,in pm2 chalk doesn't take any effection


Just try:
{
"apps": [
{
"[SOME]":"[CONFIGS]",
"args": [
"--color"
]
}
]
}
or
$ pm2 start myapp.js -- --color
@Tjatse Thank you
Where is this "--color" option coming from? Is this a nodejs thing? Its not a pm2 option, is it?
Nope it's a chalk thing: see supports-color, a dependency of Chalk, where the dependency has-flag checks whether process.argv has --no-color.
This didn't work for me:
$ pm2 start myapp.js -- --color
This supportsColor worked:
$ FORCE_COLOR=1 pm2 start myapp.js
Most helpful comment
Just try:
or