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.

    NPM restart issue

    Scheduled Pinned Locked Moved Troubleshooting
    9 Posts 2 Posters 5.9k Views 1 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.
    • KirAsh4K Offline
      KirAsh4 Moderator
      last edited by

      Does it work if you remove the module you recently added? If so, it’s not an npm nor electron problem. It’s the module, probably a bad configuration, either in the module settings, or in your config.js.

      A Life? Cool! Where can I download one of those from?

      1 Reply Last reply Reply Quote 0
      • M Offline
        mikmonken
        last edited by

        i don’t think it did, fortunately i backed up my RPI before i add the module so i’ll try a fresh install and see if that works.

        I was adding back in the compliments module so i could put a happy birthday message on so had change the narrative in the compliments module.

        1 Reply Last reply Reply Quote 0
        • M Offline
          mikmonken
          last edited by

          OK so after a fresh install all seemed to work, i’ve just tried to log in via SSH from outside my network, and so i could see the mirror ran the server only mode command and it churns out this.

          pi@Mirror:~/MagicMirror $ node serveronly
          Loading config ...
          WARNING! Could not find config. Please create one.
          Loading module helpers ...
          No helper found for module: helloworld.
          All module helpers loaded.
          Starting server op port 8080 ... 
          Server started ...
          Sockets connected & modules started ...
          
          Ready to go! Please point your browser to: http://localhost:8080
          Whoops! There was an uncaught exception...
          { Error: listen EADDRINUSE :::8080
              at Object.exports._errnoException (util.js:1008:11)
              at exports._exceptionWithHostPort (util.js:1031:20)
              at Server._listen2 (net.js:1253:14)
              at listen (net.js:1289:10)
              at Server.listen (net.js:1385:5)
              at new Server (/home/pi/MagicMirror/js/server.js:17:9)
              at /home/pi/MagicMirror/js/app.js:121:17
              at loadConfig (/home/pi/MagicMirror/js/app.js:45:4)
              at start (/home/pi/MagicMirror/js/app.js:107:3)
              at Object.<anonymous> (/home/pi/MagicMirror/serveronly/index.js:2:5)
            code: 'EADDRINUSE',
            errno: 'EADDRINUSE',
            syscall: 'listen',
            address: '::',
            port: 8080 }
          MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
          If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
          

          So could it be the act of running the Server only mode that causes the issue? as now i get all the same errors listed above when i try to run pm restart?

          Just as a side note that despite getting the error it still let me log onto the mirror through safari on :8080

          KirAsh4K 1 Reply Last reply Reply Quote 0
          • KirAsh4K Offline
            KirAsh4 Moderator @mikmonken
            last edited by

            @mikmonken said in NPM restart issue:

            pi@Mirror:~/MagicMirror $ node serveronly
            Loading config …
            WARNING! Could not find config. Please create one.

            That right there should be your clue … You have an error in your 'config.js'.

            A Life? Cool! Where can I download one of those from?

            1 Reply Last reply Reply Quote 0
            • M Offline
              mikmonken
              last edited by

              this is where i’m out of my depth then, does the fact that the mirror boots fine on RPI start up not mean that the config.js is OK?

              I’m guessing not, but is there an easy way to debug? usually if the config.js file is wrong (say i get a comma out of place) then mirror just boots onto the default you’ve got a problem with the config.js screen check you have one page, which doesn’t happen with this error?

              1 Reply Last reply Reply Quote 0
              • KirAsh4K Offline
                KirAsh4 Moderator
                last edited by

                Actually, you can’t run both the default startup of the mirror, AND a serveronly. Once the mirror is up and running, just open a browser from wherever you are and load up the rpi’s address with the configured port. I believe you said that’s :8080. I guess I don’t understand why you are trying to also run serveronly …

                A Life? Cool! Where can I download one of those from?

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mikmonken
                  last edited by

                  Arrrr that’s Because I didn’t realise you could access Mirror through the browser without a running. And I hadn’t thought to test it out.

                  So I’m basically providing two conflicting commands that’s causing the error then. (In its most basic of explanations)

                  Thanks for your answers though. Do you ever sleep?

                  1 Reply Last reply Reply Quote 0
                  • KirAsh4K Offline
                    KirAsh4 Moderator
                    last edited by

                    Sleep? Is there a definition for that? :)

                    To note: the npm process starts up Electron in kiosk mode on the rpi. Electron is simply a browser, which then loads the localhost address to MM². So if you know your rpi’s address on your network, you can load it up anywhere through a browser.

                    In case you haven’t seen it, I posted how my (development) setup is, and it hints at doing just that with a remote browser:
                    https://forum.magicmirror.builders/topic/265/my-setup-or-how-crazy-i-am

                    A Life? Cool! Where can I download one of those from?

                    1 Reply Last reply Reply Quote 0
                    • 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