When I run
gcloud compute ssh user@instance-1
And then when I am ssh'd in, I type pm2
and it prints out a help message, as expected.
If I instead run
gcloud compute ssh user@instance-1 --command "pm2"
It prints out bash: pm2: command not found
I had previously installed pm2
(by running npm install -g pm2
as both the root user and user
for good measure).
What is going on here?