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.

    node serveronly works, but npm start doesn't

    Scheduled Pinned Locked Moved Solved Troubleshooting
    5 Posts 2 Posters 912 Views 2 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.
    • N Offline
      nealterrell
      last edited by

      How can I go about diagnosing an issue where node serveronly works fine, but npm start (whether on a terminal or via pm2) fails silently? The only log information from npm is this:

      > magicmirror@2.10.0 start /home/pi/MagicMirror
      > ./run-start.sh
      [15:42:38.586] [LOG]    Starting MagicMirror: v2.10.0
      [15:42:38.595] [LOG]    Loading config ...
      [15:42:38.600] [LOG]    Loading module helpers ...
      [15:42:38.689] [LOG]    Initializing new module helper ...
      [15:42:38.690] [LOG]    Module helper loaded: MMM-Remote-Control
      
      (process terminates)
      

      It’s something to do with the MMM-PIR-Sensor module – removing it from config fixes npm start – but the module works fine in node serveronly mode, so I am having trouble identifying the problem.

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

        @nealterrell did u install 2.10 or upgrade? Did u use one of the scripts?

        What pi is this

        run-start.sh had been updated to auto detect serveronly in config.js, or on systems where electron doesn’t work.

        Edit the run-start.sh and add a space and -x to the first line

        And then do npm start

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        N 2 Replies Last reply Reply Quote 0
        • N Offline
          nealterrell @sdetweil
          last edited by nealterrell

          @sdetweil Thank you for your reply. Raspberry Pi 4. Initially I upgraded with git pull && npm install, but I found your upgrade script and ran that. Now I added -x to run-start, and this is the output:

          > magicmirror@2.10.0 start /home/pi/MagicMirror
          > ./run-start.sh
          
          + ./untrack-css.sh
          + '[' -z :0.0 ']'
          ++ uname -m
          + arch=armv7l
          + false=false
          ++ grep -v '^\s//' config/config.js
          ++ grep -i serveronly:
          ++ awk '{print tolower($2)}'
          ++ tr -d ',"'\'''
          + serveronly=
          + serveronly=false
          ++ pgrep Xorg
          + xorg=454
          ++ uname
          + mac=Linux
          + '[' false. '!=' false. -o armv7l == armv6l ']'
          + '[' 454. == . -a Linux '!=' Darwin ']'
          + electron js/electron.js
          [17:16:24.796] [LOG]    Starting MagicMirror: v2.10.0
          [17:16:24.810] [LOG]    Loading config ...
          [17:16:24.820] [LOG]    Loading module helpers ...
          [17:16:24.948] [LOG]    Initializing new module helper ...
          [17:16:24.949] [LOG]    Module helper loaded: MMM-Remote-Control
          

          I added some logging to app.js where it loads modules, and the process terminates on the line Module = require(helperPath) when helperPath is the MMM-PIR-Sensor module.

          I don’t expect you to diagnose every misbehaving module, so I’ll continue to dig and see what went wrong. Any advice would be appreciated; especially regarding why there’s no issue with node serveronly.

          1 Reply Last reply Reply Quote 0
          • N Offline
            nealterrell @sdetweil
            last edited by

            @sdetweil I found that MMM-PIR-Sensor was failing when requiring onoff, so I wiped its node_modules, npm install, and now everything is fine. Sorry for wasting your time!

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

              @nealterrell but my script was supposed to run the npm install for you.

              Can u send me the installers/upgrade.log

              Same Id as here on Gmail. Thx

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              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