mscdex / ssh2

SSH2 client and server modules written in pure JavaScript for node.js
MIT License
5.54k stars 665 forks source link

pm2 restart 0 No data is returned #1381

Closed wjg55555 closed 7 months ago

wjg55555 commented 8 months ago

The pm2 command cannot be used remotely. The node command is successful

wjg55555 commented 8 months ago

Is there any configuration on the server that I didn't set?

What are the configurations of the pm2 remote deployment server?

theophilusx commented 8 months ago

PM2 is unrelated to ssh2-sftp-client module. You will need to get support from a pm2 specific forum

mscdex commented 8 months ago

I'm not sure why you'd expect output from a restart command, but maybe pm2 does?

The only thing I can think of is maybe pm2 is expecting a TTY. If so, you will need to explicitly request a pty if you're using ssh.exec() since it does not do so default (compared to ssh.shell() which does). The documentation for ssh.exec() shows how you can request a pty.

If that doesn't help then I'm afraid you will need to submit an issue on the pm2 issue tracker as I am not familiar with pm2 at all.