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.

    npm start dev

    Scheduled Pinned Locked Moved Troubleshooting
    13 Posts 5 Posters 15.2k 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.
    • S Offline
      shavesophere
      last edited by paviro

      Hi Bangee

      I’ve had exactly the same problem. I’ve tried it on a rasp 2, a rasp 3 and still the same result. Tried reinstalling node.js, reinstalling npm. I’m beginning to think there’s something up with Mich;s installation script but I cant find any clues in the output. Apparently it’s known that sometimes electron will fail on some rasp 2’s- so i went ou t and bought a rasp 3. I’m currently trying it again on a new card - if it doesn’t work this time i’ll try the manual install method. No luck yet.

      pi@magicpi:~ $ cd MagicMirror/config
      pi@magicpi:~/MagicMirror/config $ cp config.js.sample config.js
      pi@magicpi:~/MagicMirror/config $ cd $HOME/MagicMirror
      pi@magicpi:~/MagicMirror $ npm start
      
      > magicmirror@2.0.0 start /home/pi/MagicMirror
      > electron js/electron.js
      
      
      npm ERR! Linux 4.4.11-v7+
      npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
      npm ERR! node v6.6.0
      npm ERR! npm  v3.10.3
      npm ERR! code ELIFECYCLE
      npm ERR! magicmirror@2.0.0 start: `electron js/electron.js`
      npm ERR! Exit status 1
      npm ERR! 
      npm ERR! Failed at the magicmirror@2.0.0 start script 'electron js/electron.js'.
      npm ERR! Make sure you have the latest version of node.js and npm installed.
      npm ERR! If you do, this is most likely a problem with the magicmirror package,
      npm ERR! not with npm itself.
      npm ERR! Tell the author that this fails on your system:
      npm ERR!     electron js/electron.js
      npm ERR! You can get information on how to open an issue for this project with:
      npm ERR!     npm bugs magicmirror
      npm ERR! Or if that isn't available, you can get their info via:
      npm ERR!     npm owner ls magicmirror
      npm ERR! There is likely additional logging output above.
      
      npm ERR! Please include the following file with any support request:
      npm ERR!     /home/pi/MagicMirror/npm-debug.log
      

      Note from admin: Please use Markdown on code snippets for easier reading!

      1 Reply Last reply Reply Quote 0
      • O Offline
        ostfilinchen
        last edited by

        Hey!

        in the readme i found this:

        Important: npm start does not work via SSH, use DISPLAY=:0 nohup npm start & instead. This starts the mirror on the remote display.

        1 Reply Last reply Reply Quote 0
        • S Offline
          shavesophere
          last edited by

          Thanks ost - but I have tried it both from direct physical keyboard and SSH using this command. I’ve been reading a few other problems related to this issue but all seems to come down to “not installing as root user”. Which i’m not - I’m installing as pi. So still scratching my head here.

          1 Reply Last reply Reply Quote 1
          • O Offline
            ostfilinchen
            last edited by

            do you have create an mm.sh and starts this with pm2?

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              shavesophere @ostfilinchen
              last edited by

              @ostfilinchen I was just using the standard install script that comes on the tutorial.

              curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh | bash

              1 Reply Last reply Reply Quote 0
              • O Offline
                ostfilinchen
                last edited by

                and do u do these steps: https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror

                1 Reply Last reply Reply Quote 0
                • BangeeB Offline
                  Bangee Module Developer
                  last edited by

                  hey there
                  @ostfilinchen that’s it. to start npm from my shell it need to use this command:
                  DISPLAY=:0 npm start dev

                  But with this I can not debug my script. Electron crashes alwasy on startup when I’ve activated my new module using const sensorLib = require('node-dht-sensor') in my node_helper.js

                  How can I debug this error?

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    shavesophere
                    last edited by

                    OK i think i’ve solved it. magic mirror HAS to be started (npm start) from a terminal window in the x-window server. you cannot start it over ssh.

                    bheplerB KirAsh4K 2 Replies Last reply Reply Quote 1
                    • bheplerB Offline
                      bhepler Module Developer @shavesophere
                      last edited by

                      @shavesophere Thank you. This at least got me to the point where I can show the display on a monitor. Now I just have to walk to the other room to see my changes. :/

                      1 Reply Last reply Reply Quote 0
                      • KirAsh4K Offline
                        KirAsh4 Moderator @shavesophere
                        last edited by

                        @shavesophere said in npm start dev:

                        OK i think i’ve solved it. magic mirror HAS to be started (npm start) from a terminal window in the x-window server. you cannot start it over ssh.

                        Not true. It can be started over SSH just fine: DISPLAY=:0 npm start

                        A Life? Cool! Where can I download one of those from?

                        S 1 Reply Last reply Reply Quote 0
                        • S Offline
                          shavesophere @KirAsh4
                          last edited by

                          @KirAsh4 sorry - i stand corrected! but that being said when i first started getting npm ERRS i tried this and it still did not work… anyway, moving forward now!

                          KirAsh4K 1 Reply Last reply Reply Quote 0
                          • KirAsh4K Offline
                            KirAsh4 Moderator @shavesophere
                            last edited by

                            @shavesophere said in npm start dev:

                            @KirAsh4 sorry - i stand corrected! but that being said when i first started getting npm ERRS i tried this and it still did not work… anyway, moving forward now!

                            Well yeah, that’s different. If npm is giving you errors, no matter how you attempt to start it, the errors won’t magically go away. That’s like saying, the car won’t start if I’m sitting on the left side, maybe if I sit on the right side it might, but in reality there’s no gas in it. Switching seats isn’t going to fill the gas tank. :)

                            A Life? Cool! Where can I download one of those from?

                            1 Reply Last reply Reply Quote 1

                            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