Hi,
i had the same problem the last weeks.
It looks like pm2 creates the startup script for systemd with wrong parameters.
You should check if there exists a file “/etc/systemd/systemd/pm2-pi.service”
In my case the file existed but contained the following lines:
USER=root which should be USER=pi
Environment=PM2_HOME=/root/.pm2 which should be Environment=PM2_HOME=/home/pi/.pm2
PIDFile=/root/.pm2/pm2.pid which should be PIDFile=/home/pi/.pm2/pm2.pid
If the file does not exist you can create it with:
sudo pm2 startup systemd -u pi
But you need to check the values again after creating it.
In the end you can enable the script with:
sudo systemd enable pm2-pi.service
The parts in described by @Chris are needed as well