I would recommend using Docker instead of pm2, If you do want to continue using pm2 it may be worth checking the pm2 log output to see why it is not running.
I don’t want use docker cause it uses more system resources. I had a look at pm2 log and this is what it says:
C:\USERS\ADMINISTRATOR\APPDATA\ROAMING\NPM\N8N.CMD:1
@ECHO off
^
SyntaxError: Invalid or unexpected token
at wrapSafe (node:internal/modules/cjs/loader:1486:18)
at Module._compile (node:internal/modules/cjs/loader:1528:20)
at Object..js (node:internal/modules/cjs/loader:1706:10)
at Module.load (node:internal/modules/cjs/loader:1289:32)
at Function._load (node:internal/modules/cjs/loader:1108:12)
at Object.<anonymous> (C:\ProgramData\pm2-etc\node_modules\pm2\lib\ProcessContainerFork.js:33:23)
at Module._compile (node:internal/modules/cjs/loader:1554:14)
at Object..js (node:internal/modules/cjs/loader:1706:10)
at Module.load (node:internal/modules/cjs/loader:1289:32)
at Function._load (node:internal/modules/cjs/loader:1108:12)
I think it interprets n8n.cmd as a Javascript code
It looks that way, Sadly as we don’t officially support pm2 though I am not sure what the best fix would be there.
Have you made an ecosystem file yet I have seen users take that approach in the past and it has worked.
When it comes to docker and resources in theory it is very light weight and less hassle as our containers have everything you need and are less prone to issues caused by system changes this is why we recommend containers in production environments.