MagicMirrorOrg / MagicMirror

MagicMirror² is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror² allows you to convert your hallway or bathroom mirror into your personal assistant.
http://magicmirror.builders
MIT License
19.66k stars 4.19k forks source link

config.js issue #2014

Closed 24lbragg closed 4 years ago

24lbragg commented 4 years ago

Hi guys,

my issue is that when i run npm run config: check, i get this: Line 132 col 2 Parsing error: Unexpected token ]

it is at the end of the config that bracket is the one signifying the end of the module list. the code is as follows:

/ Magic Mirror Config Sample

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 or empty, 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"],

useHttps: false,        // Support HTTPS or not, default "false" will use HTTP
httpsPrivateKey: "",    // HTTPS private key path, only require when useHttps is true
httpsCertificate: "",   // HTTPS Certificate path, only require when useHttps is true

language: "en",
timeFormat: 24,
units: "metric",
// serverOnly:  true/false/"local" ,
             // local for armv6l processors, default
             //   starts serveronly and then starts chrome browser
             // false, default for all  NON-armv6l devices
             // true, force serveronly mode, because you want to.. no UI on this device

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/ical-calendar/ics/76/US_Holidays.ics"                   }
            ]
        }
    },
    {
        module: "compliments",
        position: "lower_third"
    },
    {
        module: "currentweather",
        position: "top_right",
        config: {
            location: "New York",
            locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
            appid: "YOUR_OPENWEATHER_API_KEY"
        }
    },
    {
        module: "weatherforecast",
        position: "top_right",
        header: "Weather Forecast",
        config: {
            location: "New York",
            locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
            appid: "YOUR_OPENWEATHER_API_KEY"
        }
    },
    {
        module: "newsfeed",
        position: "bottom_bar",
        config: {
            feeds: [
                {
                    title: "New York Times",
                    url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
                }
            ],
            showSourceTitle: true,
            showPublishDate: true,
            broadcastNewsFeeds: true,
            broadcastNewsUpdates: true
        }
    },
            {

            module: "MMM-MyStandings",
    position: "top_right",
    config: {
        updateInterval: 5 * 60 * 1000, // every 5 minutes
        rotateInterval: 0.5 * 60 * 1000, // every 1 minute
        sports: [
            { league: "NBA", groups: ["Atlantic", "Central", "Southeast", "Northwest", "Pacific", "Southwest"] },
            { league: "NFL", groups: ["AFC East", "AFC North", "AFC South", "AFC West", "NFC East", "NFC North", "NFC South", "NFC West"] },
            { league: "NCAAF", groups: ["American Athletic - East", "American Athletic - West", "Atlantic Coast Conference - Atlantic", "Atlantic Coast Conference - Coastal",
                                    "Big 12 Conference", "Big Ten - East", "Big Ten - West", "Conference USA - East", "Conference USA - West",
                                    "FBS Independents", "Mid-American - East", "Mid-American - West", "Mountain West - Mountain", "Mountain West - West",
                                    "Pac 12 - North", "Pac 12 - South", "SEC - East", "SEC - West", "Sun Belt - East", "Sun Belt - West"] },
            { league: "NCAAM", groups: ["America East Conference", "American Athletic Conference", "Atlantic 10 Conference", "Atlantic Coast Conference", "Atlantic Sun Conference",
                                    "Big 12 Conference", "Big East Conference", "Big Sky Conference", "Big South Conference",
                                    "Big Ten Conference", "Big West Conference", "Colonial Athletic Association", "Conference USA",
                                    "Horizon League", "Ivy League", "Metro Atlantic Athletic Conference", "Mid-American Conference",
                                    "Mid-Eastern Athletic Conference", "Missouri Valley Conference", "Mountain West Conference", "Northeast Conference",
                                    "Ohio Valley Conference", "Pac-12 Conference", "Patriot League", "Southeastern Conference",
                                    "Southern Conference", "Southland Conference", "Southwestern Athletic Conference", "Summit League",
                                    "Sun Belt Conference", "West Coast Conference", "Western Athletic Conference"] }
        ],
        nameStyle: "short",
        showLogos: true,
        useLocalLogos: true,
        showByDivision: true,
        fadeSpeed: 2000,
    }

],

};

/ DO NOT EDIT THE LINE BELOW / if (typeof module !== "undefined") {module.exports = config;}

any help would be appreciated Thanks

rejas commented 4 years ago

You're missing a closing } there in the 5th to last line, it should look like this:

                                showByDivision: true,
                fadeSpeed: 2000,
            }
        }
    ],
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}
24lbragg commented 4 years ago

Thanks! That Fixed the problem!