ZMX - IT技术交流论坛 - 无限Perfect,追求梦想 - itzmx.com

标题: 请问有大佬熟悉PM2这个进程管理器吗? [打印本页]

作者: 寻宝人2339    时间: 2023/1/29 10:02
标题: 请问有大佬熟悉PM2这个进程管理器吗?
本帖最后由 寻宝人2339 于 2023/1/30 23:49 编辑

我用start设置了两个开机自启的程序,现在想取消,但是用unstartup会报错提示:

Init system not found
C:\..\node_modules\pm2\lib\API\Startup.js:93
    if (process.getuid() != 0) {
                ^

TypeError: process.getuid is not a function
    at API.CLI.uninstallStartup (C:\..\node_modules\pm2\lib\API\Startup.js:93:17)
    at Command.<anonymous> (C:\..\node_modules\pm2\lib\binaries\CLI.js:698:9)
    at Command.listener (C:\..\node_modules\pm2\node_modules\commander\index.js:315:8)
    at Command.emit (node:events:526:28)
    at Command.parseArgs (C:\..\node_modules\pm2\node_modules\commander\index.js:651:12)
    at Command.parse (C:\..\node_modules\pm2\node_modules\commander\index.js:474:21)
    at Timeout._onTimeout (C:\..\node_modules\pm2\lib\binaries\CLI.js:206:15)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

我是先装了nodejs然后用npm命令装了pm2 startup。

请问大佬知道是哪里有什么问题吗?在网上找了一些瞎鼓捣后都没效果。。





后续:另辟蹊径直接删了进程记录,但是还是会自动恢复,此时可以尝试(pm2 cleardump(此命令好像是清空pm2 save的东西,因为我本身就是只有两个进程且都要关掉的,所以用了这个。如果进程多的还是试试其它办法吧))。
        寻找过程:又在它的github评论区看了看,找到了一个讨论类似问题的。好像是它本身的缺陷还是别的什么原因,不光win,其它系统也存在,而且不只是这个命令,还牵扯到好些命令。也有人提出了其它一些尝试,似乎在不同情况下各有不同。地址:https://github.com/Unitech/pm2/issues/4556
        懒得再搞一开始提到的unstartup命令了,以后再说吧。。
作者: hsldown    时间: 2023/1/29 18:43
你这个是Windows系统,你可以在服务里找找,或者直接更改目录,





欢迎光临 ZMX - IT技术交流论坛 - 无限Perfect,追求梦想 - itzmx.com (https://bbs.itzmx.com/) Powered by Discuz! X3.4