Read the statement by Michael Teeuw here.
CANNOT ADD MODULES
-
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;}
-
This post is deleted! -
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.
-
and your indentation is messed up making it more difficult to find errors.
You may have too much curled brackets. -
-
I prefer jshint.com
In this case you missed a single comma in lineuserlon
, so it should be:userlat: "47.302604", //MUST HAVE BOTH userlon: "-122.33621", //MUST HAVE BOTH zip: "98023"
-
@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.
-
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?
-
@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. -
@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)