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.

    Clean installation... fails left and right

    Scheduled Pinned Locked Moved Bug Hunt
    17 Posts 6 Posters 7.1k Views 4 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.
    • bheplerB Offline
      bhepler Module Developer @devinhedge
      last edited by bhepler

      @devinhedge said in Clean installation... fails left and right:

      Config info:

      RasPi 3b+
      8GB SD card
      Running on Rasbian Stretch Lite
      Attempting to run using sample config.js
      No other installed modules at this point
      Attempting to run as either server/client or server only

      Well, I think I’ve detected your problem. From the GitHub page for the Magic Mirror project:

      Note that you will need to install the latest full version of Raspbian, don’t use the Lite version.

      So. My advice is to pull your SD card and flash the full desktop version of Raspbian Stretch. I don’t think you need the “recommended software” version, but you do need the desktop.

      Edited to add: It seems others have similar problems with the latest version of Raspian. Apparently they changed something in the base images. Anyhow, follow this advice and you should be able to get back on track.

      1 Reply Last reply Reply Quote 1
      • MichMichM Offline
        MichMich @devinhedge
        last edited by

        @devinhedge said in Clean installation... fails left and right:

        Not to be snarky… really… I’m concerned that MagicMirror isn’t being maintained. During installation there are a lot of deprecated node.js module warnings, and security warnings…

        As others have said, most of your problems are because you use Raspbian Lite.

        That being said: you have a point. The auto installer script isn’t maintained as well as I want it to be. Due to the fast development speed of Raspbian, it runs into issues. Since most of the contributors don’t install the core from scratch very often, we don’t run into these issues.

        I’m considering deprecating the automatic installer and suggesting to manual install Node, clone MagicMirror and then run npm install. To be fair: that’s how I install my MagicMirror.

        Of course, PR’s to fix the auto-installer are more than welcome!

        1 Reply Last reply Reply Quote 1
        • D Offline
          dazza120
          last edited by dazza120

          Yep I tried lite on my Pi 3B+ but it doesn’t work, Stretch desktop works, but think I had to go for the full package ie all the bloat ware, I’ve uninstalled all the rubbish now, but it’s not really an issue for me as I’m running my Pi off of an SSD so no sd card size limit/price, PS I think from what I remember I had to do a manual install and then install PM2 as it didn’t boot MM after reboot

          1 Reply Last reply Reply Quote 0
          • S Offline
            shbatm Module Developer
            last edited by shbatm

            I’m seeing issues with the newest “Raspbian Stretch with desktop image” (Nov 2018–non-bloatware) as well – I did a fresh, manual installation, no errors, but electron will not start with the OpenGL driver (full KMS or fake KMS) enabled. It runs through everything fine on npm start but then just stalls at “Launching application.” If I disable OpenGL, it works fine.

            Tested at Tag v2.6.0 and on the develop branch (2.7.0-dev), same issues.

            EDIT: Definitely an issue with electron: adding app.disableHardwareAcceleration(); in js/electron.js makes it open fine.

            EDIT 2: Opened an issue for this #1500, looks like Electron v3.0.13 works.

            D S 2 Replies Last reply Reply Quote 1
            • D Offline
              devinhedge @shbatm
              last edited by

              @shbatm @dazza120 @MichMich @bhepler @Mykle1

              Okay… I think I’ve figured it out. It isn’t good news:

              I’ve brought this up on another thread, but I’ll mention here so that it is captured in context: for the last couple months Node.js and npm are currently BROKEN on RaspberryPi.

              I just tried a test this morning using the started Electron app at https://electronjs.org/docs/tutorial/first-app

              Running the automated install is a Red Herring. It is inappropriate to suggest it.

              We have to figure out how to fix the bugs in the Node.js installation for Raspberry Pi before anything else. I’m wondering if installing an older version of Node.js is the solution. If so, then what version would we start with?

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                shbatm Module Developer @devinhedge
                last edited by

                @devinhedge said in Clean installation... fails left and right:

                for the last couple months Node.js and npm are currently BROKEN on RaspberryPi.

                What version of node are you using and how are you trying to install it? Node.Js works fine with Raspberry Pi, just don’t install it from the default repos. Use these instructions:

                https://github.com/nodesource/distributions/blob/master/README.md

                I’ve installed both v8 and v10 successfully multiple times on new Pis in the last few months.

                D 1 Reply Last reply Reply Quote 0
                • S Offline
                  shbatm Module Developer @shbatm
                  last edited by

                  @shbatm said in Clean installation... fails left and right:

                  I’m seeing issues with the newest “Raspbian Stretch with desktop image” (Nov 2018–non-bloatware) as well – I did a fresh, manual installation, no errors, but electron will not start with the OpenGL driver (full KMS or fake KMS) enabled.

                  Confirming what I confirmed in the issue on GitHub just so others aren’t misled… Upgrading to Electron v3.0.13 is working fine (this is now the version installed if you use the develop branch of MM). V2.x is not working on the new Raspbian because of the OpenGL driver and we can’t use V4.x yet because of bad dependency references.

                  D 1 Reply Last reply Reply Quote 0
                  • D Offline
                    dazza120 @shbatm
                    last edited by

                    @shbatm how do I find out what version of electron I have, I’m on the latest version of Magic Mirror and would love to update everything on that side

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      shbatm Module Developer @dazza120
                      last edited by

                      @dazza120

                      cat ~/MagicMirror/node_modules/electron/package.json | grep '"version":'
                      

                      Upgrade with:

                      cd ~/MagicMirror/
                      npm install electron@3.0.13
                      
                      D 1 Reply Last reply Reply Quote 1
                      • D Offline
                        devinhedge @shbatm
                        last edited by

                        @shbatm said in Clean installation... fails left and right:

                        @devinhedge said in Clean installation... fails left and right:

                        for the last couple months Node.js and npm are currently BROKEN on RaspberryPi.

                        What version of node are you using and how are you trying to install it?

                        Current from default Rasbian repos.

                        Node.Js works fine with Raspberry Pi, just don’t install it from the default repos.

                        That may be the problem.

                        Use these instructions:

                        https://github.com/nodesource/distributions/blob/master/README.md

                        I’ve installed both v8 and v10 successfully multiple times on new Pis in the last few months.

                        I’ll give it a whirl. I was able to recreate the error 4 times so I just need to copy over the steps to recreate. I don’t have a lot of time to spend on it today.

                        1 Reply Last reply Reply Quote 1
                        • D Offline
                          dazza120 @shbatm
                          last edited by dazza120

                          @shbatm said in Clean installation... fails left and right:

                          cat ~/MagicMirror/node_modules/electron/package.json | grep ‘“version”:’

                          Thanks appears I was running electron 2.0.16 3.0.13 installed fixed a few vulnerabilities and all seems to be working fine on the Pi3B+

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            devinhedge
                            last edited by

                            Instructions for Installing MagicMirror on Rasbian Stretch Lite

                            Install base Rasbian Stretch Lite image

                            Update base installation

                            sudo raspi-config

                            1. Update pi password
                            2. Update Timezone
                            3. Update Keyboard
                            4. Update hostname
                            5. Update Localization (language)
                            6. Update WiFi configuration
                            7. Expand file system and reboot
                            8. Enable ssh
                            9. Update System

                            sudo apt-get update && sudo apt upgrade -y && sudo apt-get dist-upgrade

                            Install Xserver, LXDE-gui, lightdm and other nescessary things:

                            sudo apt-get install raspberrypi-ui-mods firefox-esr build-essentials git -y

                            Use raspi-config to autologin pi user to gui at boot

                            raspi-config
                            sudo reboot

                            Use Raspi

                            Install Node.js from source

                            Remove Chris Lea’s Node.js if it has accidently been installed

                            sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-.list
                            sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-
                            .list.save

                            Add the NodeSource package signing key

                            curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -

                            Add the desired NodeSource repository

                            VERSION=node_10.x
                            DISTRO=“$(lsb_release -s -c)”
                            echo “deb https://deb.nodesource.com/$VERSION $DISTRO main” | sudo tee /etc/apt/sources.list.d/nodesource.list
                            echo “deb-src https://deb.nodesource.com/$VERSION $DISTRO main” | sudo tee -a /etc/apt/sources.list.d/nodesource.list

                            Test if the installation is good.

                            curl -sL https://deb.nodesource.com/test | bash -

                            Received:

                            (node:15418) TimeoutOverflowWarning: 4294967296000 does not fit into a 32-bit signed integer.
                            Timer duration was truncated to 2147483647.
                            SUCCESS
                            (node:15418) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

                            Install the Sample Node.js Electron app

                            npm install --save-dev electron

                            Git clone the sample app

                            git clone https://github.com/electron/electron-quick-start.git

                            Then install it and run

                            cd ./electron-quick-start
                            npm install
                            npm start

                            Received:

                            0 info it worked if it ends with ok
                            1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
                            2 info using npm@6.4.1
                            3 info using node@v10.15.0
                            4 verbose run-script [ 'prestart', 'start', 'poststart' ]
                            5 info lifecycle electron-quick-start@1.0.0~prestart: electron-quick-start@1.0.0
                            6 info lifecycle electron-quick-start@1.0.0~start: electron-quick-start@1.0.0
                            7 verbose lifecycle electron-quick-start@1.0.0~start: unsafe-perm in lifecycle true
                            8 verbose lifecycle electron-quick-start@1.0.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/electron-quick-start/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
                            9 verbose lifecycle electron-quick-start@1.0.0~start: CWD: /home/pi/electron-quick-start
                            10 silly lifecycle electron-quick-start@1.0.0~start: Args: [ '-c', 'electron .' ]
                            11 silly lifecycle electron-quick-start@1.0.0~start: Returned: code: 1  signal: null
                            12 info lifecycle electron-quick-start@1.0.0~start: Failed to exec start script
                            13 verbose stack Error: electron-quick-start@1.0.0 start: `electron .`
                            13 verbose stack Exit status 1
                            13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
                            13 verbose stack     at EventEmitter.emit (events.js:182:13)
                            13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
                            13 verbose stack     at ChildProcess.emit (events.js:182:13)
                            13 verbose stack     at maybeClose (internal/child_process.js:962:16)
                            13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
                            14 verbose pkgid electron-quick-start@1.0.0
                            15 verbose cwd /home/pi/electron-quick-start
                            16 verbose Linux 4.14.79-v7+
                            17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
                            18 verbose node v10.15.0
                            19 verbose npm  v6.4.1
                            20 error code ELIFECYCLE
                            21 error errno 1
                            22 error electron-quick-start@1.0.0 start: `electron .`
                            22 error Exit status 1
                            23 error Failed at the electron-quick-start@1.0.0 start script.
                            23 error This is probably not a problem with npm. There is likely additional logging output above.
                            24 verbose exit [ 1, true ]
                            

                            I’m beginning to think about the quote:

                            Insanity: doing the same thing over and over again and expecting different results.

                            1 Reply Last reply Reply Quote 0
                            • S Offline
                              shbatm Module Developer
                              last edited by

                              @devinhedge said in Clean installation... fails left and right:

                              Install Node.js from source

                              The Nodesource install scripts will save you some time/steps:

                              curl -sL https://deb.nodesource.com/setup_10.x | bash -
                              apt-get install -y nodejs
                              

                              It looks like everything installed correctly. As has been said before:

                              @michmich said in Clean installation... fails left and right:

                              As others have said, most of your problems are because you use Raspbian Lite.

                              The electron-quick-start app tries to install electron v4.0, which as I said above, does not work on the latest version of Raspbian–you need to use v3.0.13 (npm i electron@3.0.13).

                              Also, are you trying to run electron from the Pi’s desktop or SSH? If you’re running it from SSH you need to run it with DISPLAY=:0 npm start

                              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 / 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