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.

    MMM-Sunrise-Sunset

    Scheduled Pinned Locked Moved Utilities
    44 Posts 9 Posters 19.3k Views 10 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
      sdetweil @dankerthrone
      last edited by

      @dankerthrone said in MMM-Sunrise-Sunset:

      Uncaught ReferenceError: $ is not defined

      cp node/modules/jquery/dist/jquery.js .
      

      should be (notice the underscore, _ instead of the slash /)

      cp node_modules/jquery/dist/jquery.js .
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

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

        That seems to have been a copy/paste-error. My terminal history shows it with the underscore. To make sure, I tried it once again, but still get

        pi@raspberrypi:~/MagicMirror/modules/MMM-Sunrise-Sunset $ cp node_modules/jquery/dist/jquery.js .
        cp: cannot stat 'node_modules/jquery/dist/jquery.js': No such file or directory
        
        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @dankerthrone
          last edited by

          @dankerthrone weird
          show the output of

          cd  ~/MagicMirror/modules/MMM-Sunrise-Sunset
          ls node_modules -laF
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            dankerthrone @sdetweil
            last edited by

            @sdetweil

            pi@raspberrypi:~/MagicMirror/modules/MMM-Sunrise-Sunset $ ls node_modules -laF
            ls: cannot access 'node_modules': No such file or directory
            
            

            … I’m starting to wonder if I messed up something bigger in the beginning since almost any change I apply to config.js results in weird errors.

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

              after rebooting, the black screen of MagicMirror now shows this in the developer console:

              Starting module: MMM-Sunrise-Sunset
              MMM-Sunrise-Sunset.js:50 Uncaught ReferenceError: $ is not defined
                  at Class.updateSun (MMM-Sunrise-Sunset.js:50)
                  at Class.start (MMM-Sunrise-Sunset.js:12)
                  at startModules (loader.js:55)
                  at loader.js:40
                  at HTMLLinkElement.stylesheet.onload (loader.js:200)
              DailyXKCD.js:77 https://imgs.xkcd.com/comics/hotel_room_party.png
              7
              DailyXKCD.js:177 Uncaught TypeError: Cannot read property 'naturalHeight' of null
                  at Class.scrollComic (DailyXKCD.js:177)
                  at DailyXKCD.js:51
              6
              DailyXKCD.js:177 Uncaught TypeError: Cannot read property 'naturalHeight' of null
                  at Class.scrollComic (DailyXKCD.js:177)
                  at DailyXKCD.js:51
              

              I’m really starting to think I do something stupid everytime I install/clone a module from github. I do follow each readme.md for installation, but somehow keep messing up :-/

              S 2 Replies Last reply Reply Quote 0
              • S Offline
                sdetweil @dankerthrone
                last edited by sdetweil

                @dankerthrone installing a new module is pretty easy

                cd MagicMirror/modules
                git clone http:// the url of the git repo
                cd the name of the module
                

                if there is a package.,json file, then to load its dependencies do

                npm install 
                

                then

                cd ~/MagicMirror/config
                nano config.js
                
                insert the module definition  info, (see the module readme.md)
                save
                

                then restart mirror app

                this module does NOT list its dependency on jquery as it should
                so, you have to fix it manually.

                SO, i don’t know where you were when u did the npm install jquery
                lets find it

                cd ~/MagicMirror
                find . | grep jquery\.js
                

                Sam

                How to add modules

                learning how to use browser developers window for css changes

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

                  @dankerthrone said in MMM-Sunrise-Sunset:

                  DailyXKCD

                  the XKCD errors look like poor programming by the author

                  he tries to find the web content before its there, but doesn’t check if he got the location

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    dankerthrone @sdetweil
                    last edited by

                    @sdetweil
                    finding jquery as you suggested returns

                    pi@raspberrypi:~/MagicMirror $ find . | grep jquery\.js
                    ./node_modules/nwmatcher/src/modules/nwmatcher-jquery.js
                    
                    
                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @dankerthrone
                      last edited by

                      @dankerthrone hm… not where I would have expected it…

                      so. lets try this again

                      cd ~/MagicMirror/modules/MMM-Sunrise-Sunset
                      npm install jquery
                      ls node_modules/jquery
                      

                      you should see this

                      AUTHORS.txt  LICENSE.txt  README.md  bower.json  dist  external  package.json  src
                      

                      then do

                       cp node_modules/jquery/dist/jquery.js .
                      

                      then

                      ls jquery.js
                      

                      to prove the file is in the module folder

                      i just did it all here step by step

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

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

                        Late to the game, but I also am getting black screen after installing the module and adding it to my config. Ill try to give you the steps:

                        Did the git pull. Went into the folder, npm install.

                        Added this to my config:

                        {          
                        module: 'MMM-Sunrise-Sunset', 
                        position: "bottom_center",
                        config: {
                        latitude: "69.13",
                        longitude: "18.59",
                        apiKey: "myAPI",
                        layout: "inline",
                          }
                        }, 
                        

                        I also tried @sdetweil post, without any difference. I find the files as listed, did pm2 restart mm without any help.

                        Ideas?

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