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.

    CANNOT ADD MODULES

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    14 Posts 7 Posters 4.4k Views 6 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.
    • A Offline
      anhanyoung
      last edited by

      For the mother fucking life of me, I have been working on this for 8 hours now trying to upload different modules. Every time I do, it either doesn’t show up on the screen or says I need to a config, which I already have.

      /* Magic Mirror Config Sample
       *
       * By Michael Teeuw http://michaelteeuw.nl
       * MIT Licensed.
       *
       * For more information how you can configurate this file
       * See https://github.com/MichMich/MagicMirror#configuration
       *
       */
      
      var config = {
      	address: "localhost", // Address to listen on, can be:
      	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
      	                      // - another specific IPv4/6 to listen on a specific interface
      	                      // - "", "0.0.0.0", "::" to listen on any interface
      	                      // Default, when address config is left out, is "localhost"
      	port: 8080,
      	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
      	                                                       // or add a specific IPv4 of 192.168.1.5 :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
      	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
      
      	language: "en",
      	timeFormat: 12,
      	units: "metric",
      
      	modules: [
      		{
      			module: "alert",
      		},
      		{
      			module: "updatenotification",
      			position: "top_bar"
      		},
      		{
      			module: "clock",
      			position: "top_left"
      		},
      		{
      			module: "calendar",
      			header: "US Holidays",
      			position: "top_left",
      			config: {
      				calendars: [
      					{
      						symbol: "calendar-check",
      						url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics"
      					}
      				]
      			}
      		},
      		{
      			module: "compliments",
      			position: "lower_third"
      		},
      		{
        			  module: 'MMM-lyft',
         			 position: 'top_left',
      			   header: 'Lyft (DC)',
      			  config: {
              lat: 47.3025085,  // use your exact pickup loaction
              lng: -122.3361409, // use your exact pickup loaction
              clientId: '<_n-YCNuBuJRV>', 
              clientSecret: '<Wcoq_0QSQFcinV8Al_aKjfMB4dAz9oQJ>',
          }
      },
      		        {
              module: 'MMM-NOAA3',
      	position: 'top_left',
              config: {
      		    provider: "accuweather", // From list above
      		    apiKey: "GFT6iF5ELpZ7pBYxzWabkEDAd8ZrK1HD",        // From one of the providers listed above
      		    airKey: "AyY8mD8jWGvFrgBv8",    
      	        css: "NOAA3",                   // THIS MUST CONTAIN A CSS STYLE NAME 
      		userlat: "47.302604", //MUST HAVE BOTH
      	        userlon: "-122.33621"  //MUST HAVE BOTH
      		zip: "98023"
      	 }
               },
      		
      	]
      
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== "undefined") {module.exports = config;}
      
      
      Mykle1M 1 Reply Last reply Reply Quote 0
      • brobergB Offline
        broberg Project Sponsor
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • lavolp3L Offline
          lavolp3 Module Developer
          last edited by lavolp3

          Try finding errors with

          npm run config:check
          

          to find errors in the config.

          You can also use online tools like jslint.com (past your code there)

          You need to remove commas in line 19 and 54
          and need to add one in line 59.

          …and maybe even more.

          How to troubleshoot modules
          MMM-soccer v2, MMM-AVStock

          1 Reply Last reply Reply Quote 0
          • lavolp3L Offline
            lavolp3 Module Developer
            last edited by

            and your indentation is messed up making it more difficult to find errors.
            You may have too much curled brackets.

            How to troubleshoot modules
            MMM-soccer v2, MMM-AVStock

            1 Reply Last reply Reply Quote 0
            • Mykle1M Offline
              Mykle1 Project Sponsor Module Developer @anhanyoung
              last edited by

              @anhanyoung

              https://forum.magicmirror.builders/topic/4231/how-to-add-modules-for-absolute-beginners

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 0
              • yawnsY Offline
                yawns Moderator
                last edited by

                I prefer jshint.com
                In this case you missed a single comma in line userlon, so it should be:

                		userlat: "47.302604", //MUST HAVE BOTH
                	        userlon: "-122.33621",  //MUST HAVE BOTH
                		zip: "98023"
                
                lavolp3L 1 Reply Last reply Reply Quote 1
                • lavolp3L Offline
                  lavolp3 Module Developer @yawns
                  last edited by

                  @yawns said in CANNOT ADD MODULES:

                  I prefer jshint.com

                  This really is way better! Great! Doesn’t complain about tabs for indentation which is annoying with the other tool.

                  How to troubleshoot modules
                  MMM-soccer v2, MMM-AVStock

                  1 Reply Last reply Reply Quote 1
                  • A Offline
                    anhanyoung
                    last edited by

                    Thank you guys! I will try using those sites. Didn’t know they existed. Oh man. Would that be a help. Another question, for d ample, the compliments and weather module, when I change it in the config, do I have to change it in the module folder as well? Adding more compliments and such?

                    lavolp3L 2 Replies Last reply Reply Quote 0
                    • lavolp3L Offline
                      lavolp3 Module Developer @anhanyoung
                      last edited by

                      @anhanyoung Every module is designed in a way that you don’t have to mess with the module files (MMM-*.js, node_helper.js) themselves.
                      Otherwise, if you’re not common with git, you will run into problems as soon as you want/need to update the module.
                      So always try to use config/config.js, css/customs.css or external files for tpurposes like these. In most caeses it’s described in the Readme of the config or here in the forum.

                      How to troubleshoot modules
                      MMM-soccer v2, MMM-AVStock

                      1 Reply Last reply Reply Quote 0
                      • lavolp3L Offline
                        lavolp3 Module Developer @anhanyoung
                        last edited by

                        @anhanyoung said in CANNOT ADD MODULES:

                        when I change it in the config, do I have to change it in the module folder as well? Adding more compliments and such?

                        No, you only need to change it in the config.js, or in the external json. The module file contains default values that will be overwritten by the values in the config.js or external files (e.g. for compliments)

                        How to troubleshoot modules
                        MMM-soccer v2, MMM-AVStock

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