Read the statement by Michael Teeuw here.
PM2 Error
-
Ok so I’m following the guide to install the mirror. I’m now at the auto start part. I did the command “sudo npm install -g pm2” as pi user. Next I did “pm2 startup”, I do the command I ask and I get and error.

Please help!
-
@KnottyCord Don’t you have to add your mm.sh in the start command? I’m also new at this, so I could be very wrong at this.
-
-
KnottyCord is right.
pm2 startupis not used to start the mm2 process but to start and initialize pm2 itself.
Just to be sure … you ranpm2 startupand that told you to run the command your screenshot shows? There are other users with similar problems: https://github.com/Unitech/pm2/issues/2574 -
Yes that’s what i did. Run the command pm2 startup. It gave me a command to enter. When I pressed enter it was not working I keep giving me an error!
-
Changing the command form this:
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi"to this:
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup systemd -u pi --hp /home/pi"
seem to work! -
@KnottyCord You are correct - you are running systemd (not plain old linux). PM2 does not seem to “realize” that.
Note that there is ANOTHER problem with PM2 that is now reported as a bug - read all about it here:
https://forum.magicmirror.builders/topic/2065/solved-pm2-does-not-start-on-reboot/10
Best of luck - and don’t hesitate to ask for help!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login