I'm using npm version 8.5.2
, pm2 version 5.2.2
and concurrently version 7.4.0
.
I'm trying to create a script to start my server through pm2 ecosystem.config.js
and using pm2 monit
while opening a new cmd.exe to run jsreport
These are my scripts:
"scripts": {
"start": "node server.js",
"debug": "npx nodemon --inspect server.js",
"nodemon": "npx nodemon server.js",
"pm2": "npx pm2 kill -all && npx pm2 start ecosystem.config.js && npx pm2 monit",
"pm2-kill": "npx pm2 kill -all",
"jsreport_additional": "cd E:/Progetti/SINA/sios-report && npx jsreport start",
"jsreport": "start cmd.exe @cmd /k npm run jsreport_additional",
"startAll": "concurrently \"npm run pm2\" \"npm run jsreport\""
},
The script I'm using is startAll
: that run my node server through pm2
and file ecosystem, then it monits it. In parallel it open a new cmd to run jsreport.
It works well but it doesn't monit it correctly. It tries to open it but the cmd remains blank.
When i run the single script npm run pm2
it appears like this (with all the daemons spawn in the upper part)
But when i do with startAll
, it creates the daemon but it remains blank. It seems he doesn't like pm2 monit
while using concurrently
.
Any suggestion?