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.

    how to update my MM

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    45 Posts 3 Posters 13.6k 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.
    • mumblebajM Offline
      mumblebaj Module Developer @RIKKO14
      last edited by mumblebaj

      @rikko14 Can you run the following command and post the output please?

      grep -r -E '('request')' ~/MagicMirror/modules/*/*.js
      

      Or post the pm2 logs again? There must be a module that is missing a module as per what Sam advised previously. Let us see if we can find the module that is broken.

      Check out my modules at: https://github.com/mumblebaj?tab=repositories
      Check my blog-post: https://mumblebaj.xyz/

      1 Reply Last reply Reply Quote 0
      • R Offline
        RIKKO14
        last edited by

        pi@raspberrypi:~ $ grep -r -E '('request')' ~/MagicMirror/modules/*/*.js
        /home/pi/MagicMirror/modules/MMM-Jast/node_helper.js:(()=>{"use strict";var e={944:function(e,t,o){var r=this&&this.__awaiter||function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=o(543),i=o(61);e.exports=n.create({start(){console.log(`${this.name} helper method started...`)},requestStocks(e){return r(this,void 0,void 0,(function*(){let t=[];for(const o of e.stocks)try{const{summaryDetail:e,price:r}=yield i.default.quoteSummary(o.symbol);if(e&&r){const n={symbol:o.symbol,name:o.name,quantity:o.quantity};t.push({summaryDetail:e,price:r,meta:n})}}catch(e){console.error("There was an error requesting the API.",e.message)}return t}))},socketNotificationReceived(e,t){return r(this,void 0,void 0,(function*(){if(e){const e=yield this.requestStocks(t);this.sendSocketNotification("STOCKS_RESULT",e)}else console.warn(`${e} is invalid notification`)}))}})},543:e=>{e.exports=require("node_helper")},61:e=>{e.exports=require("yahoo-finance2")}},t={},o=function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,o),i.exports}(944);module.exports=o})();
        /home/pi/MagicMirror/modules/MMM-MovieListings/node_helper.js:var request = require('request');
        /home/pi/MagicMirror/modules/MMM-MovieListings/node_helper.js:    request(
        /home/pi/MagicMirror/modules/MMM-MovieListings/node_helper.js:    request(
        /home/pi/MagicMirror/modules/MMM-MovieListings/node_helper.js:        request(
        /home/pi/MagicMirror/modules/MMM-soccer/MMM-soccer.js:     * @description Adds nunjuck filters and requests for league data.
        /home/pi/MagicMirror/modules/MMM-soccer/MMM-soccer.js:     * @description Sends request to the node_helper to fetch data for the current selected league.
        /home/pi/MagicMirror/modules/MMM-soccer/node_helper.js: * @external request
        /home/pi/MagicMirror/modules/MMM-soccer/node_helper.js: * @see https://www.npmjs.com/package/request
        /home/pi/MagicMirror/modules/MMM-soccer/node_helper.js:const request = require('request');
        /home/pi/MagicMirror/modules/MMM-soccer/node_helper.js: * @requires external:request
        /home/pi/MagicMirror/modules/MMM-soccer/node_helper.js:     * @param {Object} options - request optionsthe notification.
        /home/pi/MagicMirror/modules/MMM-soccer/node_helper.js:        request(options, (error, response, body) => {
        /home/pi/MagicMirror/modules/MMM-TomTomTraffic/MMM-TomTomTraffic.js:    // Instead, on the first dom request, add a <script> tag and trigger a dom refresh
        pi@raspberrypi:~ $ 
        
        
        

        I do not remember anymore how to post the pm2 logs

        mumblebajM 1 Reply Last reply Reply Quote 0
        • mumblebajM Offline
          mumblebaj Module Developer @RIKKO14
          last edited by

          @rikko14 So now you now that 2 modules require the module request. Please run the following scripts so we can determine which modules do not have request installed and post the output.

          find ~/MagicMirror/modules/* -type d -name request
          

          Check out my modules at: https://github.com/mumblebaj?tab=repositories
          Check my blog-post: https://mumblebaj.xyz/

          1 Reply Last reply Reply Quote 0
          • R Offline
            RIKKO14
            last edited by RIKKO14

            @mumblebaj

            pi@raspberrypi:~ $ find ~/MagicMirror/modules/* -type d -name request
            /home/pi/MagicMirror/modules/MMM-MovieListings/node_modules/request
            /home/pi/MagicMirror/modules/MMM-NowPlayingOnSpotify/node_modules/request
            /home/pi/MagicMirror/modules/MMM-NowPlayingOnSpotify/node_modules/npm/node_modules/request
            pi@raspberrypi:~ $ 
            
            
            mumblebajM 1 Reply Last reply Reply Quote 0
            • mumblebajM Offline
              mumblebaj Module Developer @RIKKO14
              last edited by

              @rikko14 From this output, their is one module that uses the request module that is not listed. In that module folder you now need to go and install request using the steps that Sam provided you.

              Check out my modules at: https://github.com/mumblebaj?tab=repositories
              Check my blog-post: https://mumblebaj.xyz/

              1 Reply Last reply Reply Quote 0
              • R Offline
                RIKKO14
                last edited by

                @mumblebaj i do this :

                pi@raspberrypi:~ $ find ~/MagicMirror/modules/* -type d -name request
                /home/pi/MagicMirror/modules/MMM-MovieListings/node_modules/request
                /home/pi/MagicMirror/modules/MMM-NowPlayingOnSpotify/node_modules/request
                /home/pi/MagicMirror/modules/MMM-NowPlayingOnSpotify/node_modules/npm/node_modules/request
                pi@raspberrypi:~ $ cd ~/MagicMirror/modules/MMM-NowPlayingOnSpotify
                pi@raspberrypi:~/MagicMirror/modules/MMM-NowPlayingOnSpotify $ ls package.json
                package.json
                pi@raspberrypi:~/MagicMirror/modules/MMM-NowPlayingOnSpotify $ npm init -y
                Wrote to /home/pi/MagicMirror/modules/MMM-NowPlayingOnSpotify/package.json:
                
                {
                  "name": "mmm-nowplayingonspotify",
                  "version": "1.0.0",
                  "description": "A module for MagicMirror 2 displaying the currently playing song on Spotify.",
                  "repository": {
                    "type": "git",
                    "url": "git+https://github.com/raywo/MMM-NowPlayingOnSpotify.git"
                  },
                  "keywords": [
                    "magic mirror",
                    "magic mirror 2",
                    "smart mirror",
                    "spotify",
                    "module"
                  ],
                  "author": "raywo <ray@skillbird.de> (https://github.com/raywo)",
                  "contributors": [
                    "https://github.com/raywo/MMM-NowPlayingOnSpotify/graphs/contributors"
                  ],
                  "license": "MIT",
                  "bugs": {
                    "url": "https://github.com/raywo/MMM-NowPlayingOnSpotify/issues"
                  },
                  "homepage": "https://github.com/raywo/MMM-NowPlayingOnSpotify",
                  "engines": {
                    "node": ">=7"
                  },
                  "dependencies": {
                    "cookie-parser": "1.4.3",
                    "express": "~4.16.0",
                    "moment-duration-format": "^2.2.2",
                    "npm": "^5.7.1",
                    "querystring": "~0.2.0",
                    "request": "^2.83.0",
                    "request-promise-native": "^1.0.5",
                    "body-parser": "^1.18.2"
                  },
                  "main": "MMM-NowPlayingOnSpotify.js",
                  "devDependencies": {},
                  "scripts": {
                    "test": "echo \"Error: no test specified\" && exit 1"
                  }
                }
                
                
                pi@raspberrypi:~/MagicMirror/modules/MMM-NowPlayingOnSpotify $ cd ~/MagicMirror/modules/MMM-MovieListings
                pi@raspberrypi:~/MagicMirror/modules/MMM-MovieListings $ ls package.json
                package.json
                pi@raspberrypi:~/MagicMirror/modules/MMM-MovieListings $ npm init -y
                Wrote to /home/pi/MagicMirror/modules/MMM-MovieListings/package.json:
                
                {
                  "name": "mmm-movielistings",
                  "version": "1.0.0",
                  "description": "MagicMirror module for current movie listing playing in theaters",
                  "main": "MMM-MovieListings.js",
                  "scripts": {
                    "test": "echo \"Error: no test specified\" && exit 1"
                  },
                  "author": "Christian Jens",
                  "license": "MIT",
                  "dependencies": {
                    "request": "^2.81.0"
                  },
                  "devDependencies": {},
                  "repository": {
                    "type": "git",
                    "url": "git+https://github.com/Tueti/MMM-MovieListings.git"
                  },
                  "keywords": [],
                  "bugs": {
                    "url": "https://github.com/Tueti/MMM-MovieListings/issues"
                  },
                  "homepage": "https://github.com/Tueti/MMM-MovieListings#readme"
                }
                
                
                pi@raspberrypi:~/MagicMirror/modules/MMM-MovieListings $ 
                
                

                but the problem remains the same (black screen et Electron problem)

                mumblebajM 1 Reply Last reply Reply Quote 0
                • R Offline
                  RIKKO14
                  last edited by

                  any solutions ?

                  mumblebajM 1 Reply Last reply Reply Quote 0
                  • mumblebajM Offline
                    mumblebaj Module Developer @RIKKO14
                    last edited by

                    @rikko14 You are missing the steps the sdeitwel provided. If the pacskage.json exists then you DO NOT run the npm init -y command. You must only run the npm install request command. You would or should have noticed that MMM-MovieListings already has request installed.

                    Check out my modules at: https://github.com/mumblebaj?tab=repositories
                    Check my blog-post: https://mumblebaj.xyz/

                    1 Reply Last reply Reply Quote 0
                    • mumblebajM Offline
                      mumblebaj Module Developer @RIKKO14
                      last edited by

                      @rikko14 Just a final hint. The only module that seems to have a problem is MMM-soccer. You can check that module to see if it has a package.json. If it does then DO NOT run the npm init -y. However, looking at the MMM-soccer module on Github it has been updated to use node-fetch. You probably need to do a git pull && npm install in the MMM-soccer module folder to get the latest version of the module.

                      Then start the mirror with pm2. pm2 start mm or however you start it with pm2. then pm2 stop and then pm2 log --lines 100 and post the log output if you are still experiencing the black screen.

                      Check out my modules at: https://github.com/mumblebaj?tab=repositories
                      Check my blog-post: https://mumblebaj.xyz/

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 4 / 5
                      • 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