pm2
pm2 copied to clipboard
Multi-user support for PM2 daemon on Windows
What's going wrong?
Currently, PM2 lacks support for multiple users on Windows. This is due to the IPC pipe names being hardcoded in:
https://github.com/Unitech/pm2/blob/5e708459aca32903fd363230e24c37b3e38bb48d/paths.js#L82-L88
How could we reproduce this issue?
Run PM2 as two different users on Windows.
Supporting information
Operating system: Microsoft Windows Server 2012.
$ pm2 report
connect EPERM //./pipe/rpc.sock
[PM2] Spawning PM2 daemon with pm2_home=C:\Users\user\.pm2
node:events:491
throw er; // Unhandled 'error' event
^
Error: connect EPERM //./pipe/rpc.sock
at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
Emitted 'error' event on ReqSocket instance at:
at Socket.<anonymous> (C:\Program Files\nodejs\node_modules\pm2\node_modules\pm2-axon\lib\sockets\sock.js:201:49)
at Socket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4048,
code: 'EPERM',
syscall: 'connect',
address: '//./pipe/rpc.sock'
}
Node.js v18.12.1
I faced this issue and later found out I needed to run PM2 from an admin elevated terminal. This solved the issue