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.

    I broke something

    Scheduled Pinned Locked Moved Troubleshooting
    10 Posts 3 Posters 1.1k 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.
    • K Offline
      killerjoe34
      last edited by

      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.<anonymous> (/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 ?

      1 Reply Last reply Reply Quote 0
      • K Offline
        killerjoe34
        last edited by

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

        1 Reply Last reply Reply Quote 1
        • BKeyportB Offline
          BKeyport Module Developer
          last edited by

          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.

          The "E" in "Javascript" stands for "Easy"

          1 Reply Last reply Reply Quote 0
          • K Offline
            killerjoe34
            last edited by

            @BKeyport said in I broke something:

            symlink

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

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

              @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

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • K Offline
                killerjoe34
                last edited by

                Ok, I read the man page but still don’t get it, even in french :D :(
                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 :)

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

                  @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
                  voila
                  edit the other one and change it back
                  restart MM

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    killerjoe34
                    last edited by

                    @sdetweil said in I broke something:

                    try this

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

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

                      @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

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      K 1 Reply Last reply Reply Quote 1
                      • K Offline
                        killerjoe34 @sdetweil
                        last edited by

                        @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 !

                        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