MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    PM2 error

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    13 Posts 6 Posters 6.7k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dawookie1979
      last edited by

      I get this error when trying to run pm2 startup

      pi@MagicMirror:~ $ pm2 startup
      /usr/lib/node_modules/pm2/bin/pm2:6
      if (semver.satisfies(process.versions.node, ‘>= 6.0.0’))
      ^

      TypeError: semver.satisfies is not a function
      at Object. (/usr/lib/node_modules/pm2/bin/pm2:6:12)
      at Module._compile (internal/modules/cjs/loader.js:654:30)
      at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
      at Module.load (internal/modules/cjs/loader.js:566:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
      at Function.Module._load (internal/modules/cjs/loader.js:498:3)
      at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
      at startup (internal/bootstrap/node.js:201:19)
      at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

      Please help a novice

      bheplerB 1 Reply Last reply Reply Quote 0
      • S Offline
        Status Board
        last edited by

        I have the exact same issue. Have you found a fix for this?

        1 Reply Last reply Reply Quote 0
        • lavolp3L Offline
          lavolp3 Module Developer
          last edited by lavolp3

          Have you tried reinstalling pm2 or installing the latest version?

          sudo npm install pm2@latest -g
          

          I can’t find the line mentioned in the file /usr/lib/node_modules/pm2.
          So better reinstall I guess…

          How to troubleshoot modules
          MMM-soccer v2, MMM-AVStock

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            Status Board @lavolp3
            last edited by

            @lavolp3 I have not, right now my workaround is not using pm2 at all and just starting Magic Mirror with DISPLAY=:0 npm start

            D 1 Reply Last reply Reply Quote 0
            • D Offline
              dawookie1979
              last edited by

              tried re-installing, same issue

              1 Reply Last reply Reply Quote 0
              • D Offline
                dawookie1979 @Status Board
                last edited by

                @status-board how do I do this

                lavolp3L 1 Reply Last reply Reply Quote 0
                • lavolp3L Offline
                  lavolp3 Module Developer @dawookie1979
                  last edited by

                  @dawookie1979 @Status-Board
                  can you please explain again how (the command) and from which folder you have installed pm2?
                  And what is your system running?

                  How to troubleshoot modules
                  MMM-soccer v2, MMM-AVStock

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    dawookie1979
                    last edited by

                    i have tried installing pm2 using sudo npm install pm2@latest -g command, either to the root directory or within magic mirror directory.

                    i am running raspberry pi3 Magic Mirror 2.5

                    1 Reply Last reply Reply Quote 0
                    • bheplerB Offline
                      bhepler Module Developer @dawookie1979
                      last edited by

                      @dawookie1979 - At a guess, it looks like pm2 is not compatible with the version of node that you have on your pi. I would try upgrading node then re-running the pm2 startup command.

                      1 Reply Last reply Reply Quote 1
                      • D Offline
                        dawookie1979
                        last edited by

                        thanks, i will try that. Can you give me the command / commands to run this node update.

                        Mykle1M 1 Reply Last reply Reply Quote 0
                        • Mykle1M Offline
                          Mykle1 Project Sponsor Module Developer @dawookie1979
                          last edited by

                          @dawookie1979

                          sudo apt update

                          then

                          sudo apt install nodejs

                          That should do it.

                          Create a working config
                          How to add modules

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            dawookie1979
                            last edited by

                            ok, so the way i fixed this was to totally reinstall magic mirror 2.5. Thank you for your help

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              dazza120
                              last edited by dazza120

                              I Had Similar i have just moved the pi to boot from sd to SSD that i had and for the life of me a fresh mirror 2.50 version wouldn’t run auto boot for love nor money i used this link in the end and its working well without having to kill everything and start again https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror Hope this helps someone else

                              Install PM2 using NPM:

                              sudo npm install -g pm2

                              Starting PM2 on Boot
                              To make sure PM2 can do it’s job when (re)booting your operating system, it needs to be started on boot. Luckily, PM2 has a handy helper for this.

                              pm2 startup

                              PM2 will now show you a command you need to execute.

                              Make a MagicMirror start script.
                              To use PM2 in combination with MagicMirror, we need to make a simple shell script. Preferable, we put this script outside the MagicMirror folder to make sure it won’t give us any issues if we want to upgrade the mirror.

                              cd ~
                              nano mm.sh

                              Add the following lines:

                              cd ~/MagicMirror
                              DISPLAY=:0 npm start

                              Save and close, using the commands CTRL-O and CTRL-X. Now make sure the shell script is executable bij performing the following command:

                              chmod +x mm.sh

                              You are now ready to the MagicMirror using this script using PM2.

                              Starting your MagicMirror with PM2
                              Simply start your mirror with the following command:

                              pm2 start mm.sh

                              You mirror should now boot up and appear on your screen after a few seconds.

                              Enable restarting of the MagicMirror script.
                              To make sure the MagicMirror restarts after rebooting, you need to save the current state of all scripts running via PM2. To do this, execute the following command:

                              pm2 save

                              And that’s all there is! You MagicMirror should now reboot after start, and restart after any failure.

                              Controlling you MagicMirror via PM2.
                              With your MagicMirror running via PM2, you have some handy tools at hand:

                              Restarting your MagicMirror:

                              pm2 restart mm

                              Stopping your MagicMirror:

                              pm2 stop mm

                              Show the MagicMirror logs:

                              pm2 logs mm

                              Show the MagicMirror process information:

                              pm2 show mm

                              1 Reply Last reply Reply Quote 0

                              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
                              • 1 / 1
                              • First post
                                Last post
                              Enjoying MagicMirror? Please consider a donation!
                              MagicMirror created by Michael Teeuw.
                              Forum managed by Sam, technical setup by Karsten.
                              This forum is using NodeBB as its core | Contributors
                              Contact | Privacy Policy