Я использовал PM2 для запуска файла .bat, который содержит вызов node.exe. Однако, похоже, это не работает; PM2 продолжает перезапускать .bat-файл. После слишком большого количества перезапусков PM2 отказывается.
Кто-нибудь знает, в чем причина и решение?
Используемая команда: $ pm2 start test.bat --interpreter none
Содержание test.bat: node test.js
Содержание теста. js:
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => res.send('Hello World!'))
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))
Журнал PM2:
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] starting in -fork mode-
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] online
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] starting in -fork mode-
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] online
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] starting in -fork mode-
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] online
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] starting in -fork mode-
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] online
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] starting in -fork mode-
PM2 | 2020-04-15T09:51:19: PM2 log: App [test:0] online
PM2 | 2020-04-15T09:51:20: PM2 log: App [test:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-04-15T09:51:20: PM2 log: App [test:0] starting in -fork mode-
PM2 | 2020-04-15T09:51:20: PM2 log: App [test:0] online
PM2 | 2020-04-15T09:51:20: PM2 log: App [test:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-04-15T09:51:20: PM2 log: Script C:\Users\abc\Desktop\test.bat had too many unstable restarts (16). Stopped. "errored"