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 no longer launching MM

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    38 Posts 3 Posters 14.9k Views 3 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.
    • J Offline
      JMac
      last edited by

      Hey guys, frequent searcher of this forum but this issue is the first which has me completely stuck and not able to solve with lots of Googling.

      MY MM prompted an update last week, which I did following the update guidance on the main builder site. Part way through the update failed, I had to go away for the bank holiday here in the UK and I’m now picking it back up.

      As per the title I launch the magicmirror in terminal using pm2 start mm.sh (it’s always worked) it says it’s done but then the MM never actually launches.

      when I check the pm2 logs I get an error around a directory no being empty and the node_module engine.io needing renaming.
      any thoughts on sorting this? I don’t know if this is just the first hurdle or the only reason the MM is no longer launching.
      I don’t have a programming background so please be gentle.
      Cheers.

      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @JMac
        last edited by sdetweil

        @JMac which way did u upgrade? manual, git pull, or my script?

        I see that you used the manual method, do this

        cd ~/MagicMirror
        sudo rm -rf node_modules
        npm install --omit=dev
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          JMac @sdetweil
          last edited by

          @sdetweil Thanks for your reply, your helping of others has helped me out endlessly with this project.
          I run the npm install then get an error ENOTEMPTY around /home/pi/MagicMirror/node_modules/ansi-escapes.
          saying the directory isn’t empty.

          S 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @JMac
            last edited by

            @JMac and u erased the node_modules folder ( the rm -rf)

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            J 2 Replies Last reply Reply Quote 0
            • J Offline
              JMac @sdetweil
              last edited by

              @sdetweil yes ran all three lines you posted.

              1 Reply Last reply Reply Quote 0
              • J Offline
                JMac @sdetweil
                last edited by

                @sdetweil Sorry to double reply, I ran the last 2 again and they worked ok, right up until the very end of the npm install when I got an ERR_SOCKET_TIMEOUT.
                I’m assuming this is a wifi strength issue as the position of this mirror means it struggles at times.

                S 1 Reply Last reply Reply Quote 0
                • S Do not disturb
                  sdetweil @JMac
                  last edited by

                  @JMac yeh, everything is very network dependent…

                  I ended up installing a mesh wifi system to be able to put an access point near where my hall mirror is

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    JMac @sdetweil
                    last edited by

                    @sdetweil Managed to run it a second time and everything seems happy, however, the pm2 start mm.sh still isn’t launching the MM itself.
                    Is there any other way to launch the mirror, or a way to check why it’s suddenly lost function (it was always happy launching and stopping the MM) ?

                    S 1 Reply Last reply Reply Quote 0
                    • S Do not disturb
                      sdetweil @JMac
                      last edited by

                      @JMac so, I would do this

                      pm2 stop all

                      cd ~/MagicMirror
                      npm start

                      does it run correctly?

                      you MAY have to update pm2, its just an app too…
                      depending on how old it was

                      see the pm2 --help
                      for the command to do its update

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      J 1 Reply Last reply Reply Quote 0
                      • J Offline
                        JMac @sdetweil
                        last edited by

                        @sdetweil when I run npm start from the MM folder I get:

                        magicmirror@2.23.0 start
                        DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js

                        sh: 1: ./node_modules/.bin/electron: not found

                        S 1 Reply Last reply Reply Quote 0
                        • S Do not disturb
                          sdetweil @JMac
                          last edited by

                          @JMac ok, do this

                          what device is this on? pi3?

                          cd ~/MagicMirror
                          rm -rf node_modules/electron
                          npm install electron@22.3.4
                          npm start
                          

                          please advise

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          J 1 Reply Last reply Reply Quote 0
                          • J Offline
                            JMac @sdetweil
                            last edited by

                            @sdetweil this is on a 3b+.
                            when running npm install I’m now back to an error for ENOTEMPTY for node_modules/ansi-escapes.
                            it says directory not empty.
                            I think it wants it renamed no_modules/.ansi-escapes-TiTd7xs1

                            S 1 Reply Last reply Reply Quote 0
                            • S Do not disturb
                              sdetweil @JMac
                              last edited by

                              @JMac ok, try this

                              rm -rf node_modules/electron
                              rm package-lock.json 
                              npm install electron@22.3.4
                              npm start
                              

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              J 1 Reply Last reply Reply Quote 0
                              • J Offline
                                JMac @sdetweil
                                last edited by

                                @sdetweil after running the npm install now getting a different ENOTEMPTY for nodes_modules/basic-auth.
                                Same issue of directory not empty

                                S 1 Reply Last reply Reply Quote 0
                                • S Do not disturb
                                  sdetweil @JMac
                                  last edited by

                                  @JMac weird, this makes no sense

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  J 1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    JMac @sdetweil
                                    last edited by

                                    @sdetweil I’m away with work until Friday but obviously want to try and get to the bottom of this.
                                    I’ll likely end up moving the mirror to somewhere way closer to the WiFi router.
                                    Will this stay open until the end of the week?

                                    Out of curiosity when launching via pm2 should it (in the little box that pops up in terminal) mention fork?

                                    S 2 Replies Last reply Reply Quote 0
                                    • S Do not disturb
                                      sdetweil @JMac
                                      last edited by

                                      @JMac this will stay open til u close it…

                                      yes, that is the linux term for starting an independent process

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

                                      1 Reply Last reply Reply Quote 0
                                      • S Do not disturb
                                        sdetweil @JMac
                                        last edited by sdetweil

                                        @JMac I would rename the existing mm folder
                                        and then run install again, use my script
                                        https://github.com/sdetweil/MagicMirror_scripts

                                        to help move the modules and config, I’d use my backup/restore scripts
                                        https://github.com/sdetweil/MagicMirror-backup-restore

                                        backup before rename, restore after reinstall

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          JMac
                                          last edited by

                                          may sound like a daft question but how do I rename the magicmirror folder? I’ve run your back up (hopefully).

                                          S 1 Reply Last reply Reply Quote 0
                                          • S Do not disturb
                                            sdetweil @JMac
                                            last edited by

                                            @JMac in Linux the rename command is mv

                                            cd ~
                                            mv MagicMirror newname
                                            

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            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
                                            • 2
                                            • 2 / 2
                                            • 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