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

I broke something

  • Hi everyone,
    Was cleaning my module directory, I think I deleted something I shouldn’t have…
    My mirror starts but only shows the clock.
    The RemoteControl is ok except the “hide and show modules” part that asks to check the MM logs for more details.
    That’s what I get :

    PM2            | App [MagicMirror:1] exited with code [1] via signal [SIGINT]
    PM2            | App [MagicMirror:1] starting in -fork mode-
    PM2            | App [MagicMirror:1] online
    1|MagicMirror  | [2020-07-15 08:49:12.135] [ERROR]
    1|MagicMirror  | { Error: ENOENT: no such file or directory, open 'package.json'
    1|MagicMirror  |     at Object.openSync (fs.js:443:3)
    1|MagicMirror  |     at Object.readFileSync (fs.js:343:35)
    1|MagicMirror  |     at Object. (/home/pi/MagicMirror/js/app.js:18:32)
    1|MagicMirror  |     at Module._compile (internal/modules/cjs/loader.js:778:30)
    1|MagicMirror  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    1|MagicMirror  |     at Module.load (internal/modules/cjs/loader.js:653:32)
    1|MagicMirror  |     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    1|MagicMirror  |     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    1|MagicMirror  |     at Module.require (internal/modules/cjs/loader.js:692:17)
    1|MagicMirror  |     at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39)
    1|MagicMirror  |   errno: -2,
    1|MagicMirror  |   syscall: 'open',
    1|MagicMirror  |   code: 'ENOENT',
    1|MagicMirror  |   path: 'package.json' }

    I tried to npm install all my modules again but still the same.
    Got an idea ?

  • Well, I did a fresh reinstall, it took me about 2 hours but it’s approximately working again 🙂

  • Module Developer

    I moved my personal configs to another directory and symlinked them in their proper places.

    This gives me a guide to get up and running after doing something stupid… Takes reinstall time from several hours to about 30 minutes.

  • @BKeyport said in I broke something:


    I’m not sure to exactly get what a simlink is, what’s the difference with a simple copy ?

  • @killerjoe34 linux file systems give you the ability to create a file as a LINK to another file somewhere else…

    so you only have one copy, but multiple instances… changing the root file makes it look like all the linked files changed too

    see the ln command

  • Ok, I read the man page but still don’t get it, even in french 😃 😞
    You’re saying that if the root file is modified, it also modifies the linked one(s) or does it make another copy ?
    Cause it would be perfect in that case, keeping track of every modification to be able to step back.

    Thanks for your explanations 🙂

  • @killerjoe34 no, the link makes it look like all the secondary files ARE the root file. so actually changing ANY changes them all, there is ONLY one actual file. but erasing the linked file does NOT erase the root file.

    try this

    mkdir ~/foo
    mv ~/MagicMirror/config/config.js foo
    cd ~/MagicMirror/config
    ln -s ~/foo/config.js config.js

    now you have your file in ~/foo
    but it LOOKS like it is also in ~/MagicMirror/config

    edit one, change the date/time format
    restart MM
    edit the other one and change it back
    restart MM

  • @sdetweil said in I broke something:

    try this

    Wow great 🙂
    Thanks a lot, I’ll use that !

  • @killerjoe34 you can also link folders

    if you do (in the config folder where I just set a link)

    ls -laF

    will show u the file is linked, and where to

  • @sdetweil said in I broke something:

    @killerjoe34 you can also link folders

    if you do (in the config folder where I just set a link)

    ls -laF

    will show u the file is linked, and where to

    Ok, I’ll have a look at that, thx again !

Log in to reply