pm2-intercom has always seemed a bit dodgy - for some people it never works at all anyway. It didn’t need to use git clone when I installed it. Best plan might be to use the disableClustering option in your log4js config, log to stdout and let pm2 handle the files as it normally would.
option.disableClustering 不是银弹
上面再次提到 disableClustering 选项,不错,pm2-intercom 异常的场景可以拿它救场,但要注意它本身不适用于直接写文件,每个进程都被赋予了 master 权限,会再次引发开篇的冲突问题。官方文档也明确警示:Be careful if you’re logging to files。