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.

    how to update my MM

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    45 Posts 3 Posters 17.5k 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.
    • R Offline
      RIKKO14
      last edited by

      same error :

      pi@raspberrypi:~/MagicMirror $ pm2 start
      [PM2][ERROR] File ecosystem.config.js not found
      
      

      and

      pi@raspberrypi:~ $ pm2 start
      [PM2][ERROR] File ecosystem.config.js not found
      
      

      2022-01-13-163431_1080x1920_scrot.png
      2022-01-13-163440_1080x1920_scrot.png

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @RIKKO14
        last edited by

        @rikko14 ok, (when I said pm2 start, I assumed you would know to add the name or number , pm2 start 0)

        do

        pm2 save
        pm2 start 0
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • R Offline
          RIKKO14
          last edited by

          it works but I found this Electron problem … with a black screen :
          see a the top right of my screen
          2022-01-13-164408_1080x1920_scrot.png

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @RIKKO14
            last edited by

            @rikko14 black screen… yeh. I added code to fix that but the bad file format problems prevented

            do

            pm2 stop all
            pm2 flush
            pm2 start 0

            wait til MM comes up

            pm2 stop all

            then do this (1st post is enough)
            https://forum.magicmirror.builders/topic/15778/fix-for-black-screen-in-2-16-and-later

            for each module reporting a missing library (there are more than 1 library potentially missing, so I don’t give you the exact command to issue, but teach you how to find the error and fix it from there)

            then after fixing for all modules with problem,
            (note you MAY have to repeat this looking thru the log part, I don’t know if they ALL will report, or if it will stop after the 1st error)

            pm2 start 0

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • R Offline
              RIKKO14
              last edited by

              I’m not sure I understood and did the right thing …:

              pi@raspberrypi:~ $ pm2 stop all
              [PM2] Applying action stopProcessId on app [all](ids: [ 0 ])
              [PM2] [mm](0) ✓
              ┌─────┬───────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
              │ id  │ name  │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
              ├─────┼───────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
              │ 0   │ mm    │ default     │ N/A     │ fork    │ 0        │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ pi       │ disabled │
              └─────┴───────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
              pi@raspberrypi:~ $ pm2 flush
              [PM2] Flushing /home/pi/.pm2/pm2.log
              [PM2] Flushing:
              [PM2] /home/pi/.pm2/logs/mm-out.log
              [PM2] /home/pi/.pm2/logs/mm-error.log
              [PM2] Logs flushed
              pi@raspberrypi:~ $ pm2 start 0
              [PM2] Applying action restartProcessId on app [0](ids: [ '0' ])
              [PM2] [mm](0) ✓
              [PM2] Process successfully started
              ┌─────┬───────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
              │ id  │ name  │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
              ├─────┼───────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
              │ 0   │ mm    │ default     │ N/A     │ fork    │ 29137    │ 0s     │ 0    │ online    │ 0%       │ 2.4mb    │ pi       │ disabled │
              └─────┴───────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
              pi@raspberrypi:~ $ pm2 stop all
              [PM2] Applying action stopProcessId on app [all](ids: [ 0 ])
              [PM2] [mm](0) ✓
              ┌─────┬───────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
              │ id  │ name  │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
              ├─────┼───────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
              │ 0   │ mm    │ default     │ N/A     │ fork    │ 0        │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ pi       │ disabled │
              └─────┴───────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
              pi@raspberrypi:~ $ npm init -y
              Wrote to /home/pi/package.json:
              
              {
                "name": "pi",
                "version": "1.0.0",
                "description": "",
                "main": "index.js",
                "scripts": {
                  "test": "echo \"Error: no test specified\" && exit 1"
                },
                "keywords": [],
                "author": "",
                "license": "ISC"
              }
              
              
              pi@raspberrypi:~ $ npm install ???
              npm ERR! code EINVALIDTAGNAME
              npm ERR! Invalid tag name "???": Tags may not have any characters that encodeURIComponent encodes.
              
              npm ERR! A complete log of this run can be found in:
              npm ERR!     /home/pi/.npm/_logs/2022-01-13T15_57_40_124Z-debug.log
              pi@raspberrypi:~ $ 
              
              

              2022-01-13-165939_1080x1920_scrot.png

              S 1 Reply Last reply Reply Quote 0
              • mumblebajM Offline
                mumblebaj Module Developer @sdetweil
                last edited by

                @sdetweil Maybe combine the script and check if exist then update, else frsh install? Would that work?

                Check out my modules at: https://github.com/mumblebaj?tab=repositories
                Check my blog-post: https://mumblebaj.xyz/
                Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @RIKKO14
                  last edited by

                  @rikko14 npm init -y

                  what is going on…

                  the instructions say

                  cd modulename (where modulename is the module having the error)
                  
                  if the module does NOT provide a file called package.json, then do
                  
                  npm init -y
                  
                  

                  why are you doing this in the users home folder?

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    RIKKO14
                    last edited by RIKKO14

                    so i have to do first : cd ~/MagicMirror/ and after npm init -y that’s right ?

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @mumblebaj
                      last edited by

                      @mumblebaj said in how to update my MM:

                      Maybe combine the script and check if exist then update, else frsh install? Would that work?

                      what? check if what exist?

                      the problem here is that i looped thru all the installed modules, and found a package.json, which now requires a new
                      npm install

                      in the module folder, BUT, the npm install failed cause of the networking problem

                      one that is finished, I loop thru all the modules and check to see if they use one of the troublesome libraries
                      and do NOT reference it in package.json…
                      and if NO package.json, then I create one, and THEN do the npm install of the library

                      phew, all the same as the instructions i gave in the linked topic.

                      but there might be ANOTHER library too … that I don’t handle…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      mumblebajM 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @RIKKO14
                        last edited by sdetweil

                        @rikko14 it says

                        to fix this you need to install the library in the module folder

                        cd ~/MagicMirror/modules

                        cd modulename (where modulename is the module having the error)

                        SO, you have to cd ~/MagicMirror/modules/modulename

                        same as every other time you were told to cd modulename

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          RIKKO14
                          last edited by

                          I’m lost …
                          here are all the modules I have installed.
                          2022-01-13-171057_1080x1920_scrot.png

                          I have to do: cd ~ / MagicMirror / modules / modulename for each module and then npm init -y ?
                          and post here all the results of npm init -y ?

                          I have already had this Electron problem several times and I do not remember what I had typed as the command line but it was not that

                          S 1 Reply Last reply Reply Quote 0
                          • mumblebajM Offline
                            mumblebaj Module Developer @sdetweil
                            last edited by

                            @sdetweil said in how to update my MM:

                            what? check if what exist?

                            What I was referring to is for a single script to run, check if MagicMirror exist, check version and upgrade if not on the latest, if not exist then do a fresh install. This way whoever runs your script does not run the wrong one. Just a suggestion.

                            Check out my modules at: https://github.com/mumblebaj?tab=repositories
                            Check my blog-post: https://mumblebaj.xyz/
                            Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                            S 1 Reply Last reply Reply Quote 0
                            • S Offline
                              sdetweil @RIKKO14
                              last edited by

                              @rikko14 look in the pm2 logs output

                              search for Cannot find module

                              sorry for the dual use of the word module. NPM calls the library a module and MagicMirror calls its app a module…

                              after that string, there will be a name in quotes ‘request’ or ‘valid-url’, or maybe something else

                              on one of the next lines will be a file path

                              MagicMirror/modules/??? some MagicMirror module name

                              THAT is the MagicMirror module which is missing the library found in the 'Cannot find module ’ message above

                              So, navigate to that MagicMirror module folder

                              cd ~/MagicMirror/modules/modulename 
                              

                              and then look for the package.json file

                              ls package.json
                              

                              if you get ‘No such file or directory’ in response to the ls command, then create the file by doing

                              npm init -y
                              

                              next step,

                              npm install ???
                              where ??? is the name of the missing library in the message ’ Cannot find module ’

                              done for this library for this MM module

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              1 Reply Last reply Reply Quote 0
                              • S Offline
                                sdetweil @mumblebaj
                                last edited by

                                @mumblebaj oh… no… don’t want to get into that

                                they are two distinct functions… users have to learn sometime

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                mumblebajM 1 Reply Last reply Reply Quote 0
                                • mumblebajM Offline
                                  mumblebaj Module Developer @sdetweil
                                  last edited by

                                  @sdetweil :-) I understand. But it would make your life easier with running the wrong script, messing up their install and you having to go through a 100 different things for them to do to get it fixed… :-)

                                  Check out my modules at: https://github.com/mumblebaj?tab=repositories
                                  Check my blog-post: https://mumblebaj.xyz/
                                  Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    sdetweil @mumblebaj
                                    last edited by sdetweil

                                    @mumblebaj they can’t mess up their install …

                                    install aborted as already present

                                    upgrade won’t change anything unless you ask for it.
                                    and it won’t try to upgrade to the same version, unless you report it and I tell you how to get around it.
                                    (I am constantly finding things that users don’t understand, and trying to make life easier as best I can)

                                    this particular problem is unrelated to the scripts…

                                    it was caused by a networking problem I can’t fix.
                                    and I don’t know if all this will work .

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    1 Reply Last reply Reply Quote 0
                                    • R Offline
                                      RIKKO14
                                      last edited by

                                      I do this for the first modul :

                                      pi@raspberrypi:~ $ cd ~/MagicMirror/modules/MMM-DHT-Sensor
                                      pi@raspberrypi:~/MagicMirror/modules/MMM-DHT-Sensor $ ls package.json
                                      package.json
                                      pi@raspberrypi:~/MagicMirror/modules/MMM-DHT-Sensor $ 
                                      
                                      

                                      i do this : npm init -y ?

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        sdetweil @RIKKO14
                                        last edited by

                                        @rikko14 no. the file exists.

                                        only do npm init -y if the file does NOT exist

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        1 Reply Last reply Reply Quote 0
                                        • R Offline
                                          RIKKO14
                                          last edited by

                                          @sdetweil as you told me, I do cd ~/MagicMirror/modules/modulename for each module.
                                          I found an error in the last module : MMM-WeatherOrNot, a module that I no longer use so I deleted it with the command : cd ~ / MagicMirror and rm -rf modules / MMM-WeatherOrNot then i redid pm2 save and pm2 start 0 and turned the MM off and on again with ~ 1 minute but I still have a black screen and an electron problem.
                                          what to do ?
                                          2022-01-14-090544_1080x1920_scrot.png

                                          mumblebajM 1 Reply Last reply Reply Quote 0
                                          • mumblebajM Offline
                                            mumblebaj Module Developer @RIKKO14
                                            last edited by mumblebaj

                                            @rikko14 Can you run the following command and post the output please?

                                            grep -r -E '('request')' ~/MagicMirror/modules/*/*.js
                                            

                                            Or post the pm2 logs again? There must be a module that is missing a module as per what Sam advised previously. Let us see if we can find the module that is broken.

                                            Check out my modules at: https://github.com/mumblebaj?tab=repositories
                                            Check my blog-post: https://mumblebaj.xyz/
                                            Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

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