MagicMirrorΒ² v2.13.0 is available! For more information about this release, check out this topic.

How to Troubleshoot

  • Module Developer

    Hey there beginners like me πŸ™‚

    I would like to show you, where and how to find errors while installing, using or developing MagicMirror 2.

    What we need:
    MagicMirror2 from github -> installed on a Raspberry Pi.

    Try to use the automatic install as described in the

    A really good tool to see whats going on behind your MM2 is Firebug ->
    If you run you MM2 as node serveronly you will have a lot of informations.

    Connect to your Raspberry using Putty ->
    Username: pi
    Password: raspberry

    1. Start StandaloneServer: node serveronly
    2. open your FirefoxBrowser (replace your Raspy’s IP adresse)
    3. Press F12 to start Firebug

    If you are using PM2 you will get informations running these command:
    pm2 info mm (replace mm whit your App Name)


    pi@raspberrypi:~ $ pm2 info mm
     Describing process with id 0 - name mm
    β”‚ status            β”‚ online                            β”‚
    β”‚ name              β”‚ mm                                β”‚
    β”‚ restarts          β”‚ 5                                 β”‚
    β”‚ uptime            β”‚ 3h                                β”‚
    β”‚ script path       β”‚ /home/pi/                    β”‚
    β”‚ script args       β”‚ N/A                               β”‚
    β”‚ error log path    β”‚ /home/pi/.pm2/logs/mm-error-0.log β”‚
    β”‚ out log path      β”‚ /home/pi/.pm2/logs/mm-out-0.log   β”‚
    β”‚ pid path          β”‚ /home/pi/.pm2/pids/       β”‚
    β”‚ interpreter       β”‚ bash                              β”‚
    β”‚ interpreter args  β”‚ N/A                               β”‚
    β”‚ script id         β”‚ 0                                 β”‚
    β”‚ exec cwd          β”‚ /home/pi                          β”‚
    β”‚ exec mode         β”‚ fork_mode                         β”‚
    β”‚ node.js version   β”‚ N/A                               β”‚
    β”‚ watch & reload    β”‚ ✘                                 β”‚
    β”‚ unstable restarts β”‚ 0                                 β”‚
    β”‚ created at        β”‚ 2016-05-13T08:30:59.308Z          β”‚
     Add your own code metrics:
     Use `pm2 logs mm (--lines 1000)` to display logs
     Use `pm2 monit` to monitor CPU and Memory usage mm

    Here you’ll find again a lot of informations where to find your error_log or your out_log.

    If you create a console.log("something"); debug message or output you’ll be able to see this info using the following command:
    tail -f /home/pi/.pm2/logs/mm-out-0.log (replace the path with your paht to log or error file)

    This will be continued…

    so long Bangee…

  • Admin

    Nice work! Feel free to add this to the wiki! πŸ™‚

  • Admin

    You could also use pm2 logs mm to get the logs! A bit easier than remembering the file path πŸ™‚

    If you have any problems regarding a black screen, always make sure to use to validate your config.js (just paste its content into the website). You can of course also use firebug as stated above.

  • If I am debugging code I am writing, is the easiest way to:
    -save the module.js files
    -run β€œpm2 restart mm”
    -run β€œpm2 logs mm”

    Or is there a different command that will update the code and how the system in running on the fly without having to restart the mirror each time?


  • Module Developer

    you can test your software in a browser using the webserver:

    install in firefox a tool called Firebug
    it will show you errors on the fly.
    Changes in node_helper.js requires a restart of your mirror software.

  • Is there a way to see the log via a module?

  • One command that has been a lifesaver for me when I’ve munged up the config.js is: β€œnpm run config:check”. The key is to be in the MagicMirror directory when you run it. It’ll check out your config.js and is much more convenient than pasting into

    For example here is one instance when I had multiple issues and even left the letter β€œv” at the bottom of my config.js file (on line 255). I would have never found that…The symptom was some modules would load and other would just say β€œloading” perpetually.

    pi@raspberrypi:~/MagicMirror $ npm run config:check

    magicmirror@2.1.3 config:check /home/pi/MagicMirror
    node tests/configs/check_config.js

    Checking file… /home/pi/MagicMirror/config/config.js
    Line 201 col 24 Duplicate key β€˜classes’.
    Line 223 col 20 Duplicate key β€˜classes’.
    Line 255 col 1 Expected an assignment or function call and instead saw an expression.
    Line 255 col 2 Missing semicolon.

  • @Lexingtonian Thank you for that tip with npm run config:check. Should be in the dev docs…

  • Project Sponsor Module Developer

  • While trying to debug modules, I’ve been given quite mixed feedback regarding what to use to print messages to console, on either local system or in remote browser DevTools.

    So far, I have found the only reliable way that always seem to print something in the browser, is using console.error(). The others have varied. I’m on MM v2.2.2 (master).

Log in to reply