• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

keep getting error after modifying config.js file

Scheduled Pinned Locked Moved Unsolved Troubleshooting
6 Posts 5 Posters 993 Views 4 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.
  • W Offline
    wazscience
    last edited by sdetweil Feb 2, 2020, 5:04 PM Feb 2, 2020, 4:47 AM

    Im new to the magic mirror scene, and ive just installed Magic mirror on to my pi zero w using what i learned from this page: https://forum.magicmirror.builders/topic/9386/installing-on-a-pi-zero

    after installing, the mirror runs great, and I see the modules. However, whenever I try to modify the config.js file, either to add a module or to edit an existing one, I get an error message when the mirror boots up saying that i need to read the readme file due to an error. When i remove the modifications, the mirror runs smoothly.

    here is an example of code I put in to modify the clock module:

    {
    module: “clock”,
    position: “top_left”
    config: {
    timeFormat:“12”,
    showPeriod:“false”,
    displayType:“both”,
    analogSize:“400px”
    }
    
    	},
    
    {
    module: “clock”,
    position: “top_left”
    config: {
    timeFormat:“12”,
    showPeriod:“false”,
    displayType:“both”,
    analogSize:“400px”
    }
    
    	},
    

    like I said, im new to this, and would like to better learn how to program the config file.

    M 1 Reply Last reply Feb 2, 2020, 4:27 PM Reply Quote 0
    • B Offline
      BKeyport Module Developer
      last edited by Feb 2, 2020, 8:54 AM

      in your MagicMirror folder, run " npm run config:check" after modifying your config, it’ll point out any errors you’ve made so you can fix them…

      The "E" in "Javascript" stands for "Easy"

      1 Reply Last reply Reply Quote 0
      • S Offline
        samson_82
        last edited by samson_82 Feb 2, 2020, 9:06 AM Feb 2, 2020, 9:05 AM

        @wazscience said in keep getting error after modifying config.js file:

        position: “top_left”
        position: “top_left”,

        u forgot the ( , ) at the end

        1 Reply Last reply Reply Quote 0
        • B Offline
          broberg Project Sponsor
          last edited by broberg Feb 2, 2020, 10:40 AM Feb 2, 2020, 9:47 AM

          As samson said you are missing a comma after position

          But it also likes like you are using a text editor that converts single quotes to smart quotes.

          There is a difference between “clock” and "clock".
          Use either the Nano text editor if you are working directly on the Pi, if you are working from another pc/mac change your text editor to one that doesn’t convert quotes to smart quotes (like atom, notepad+, sublime or similar)

          And, when the value of an variable is a number or true/false you don’t use any quotes at all.

          So

          {
          module: "clock",
          position: "top_left",
          config: {
             timeFormat:12,  ------------ Pure number, no quotes
             showPeriod:false,   ------------ true or false, no quotes
             displayType:"both",
             analogSize:"400px"
             }
          },
          
          1 Reply Last reply Reply Quote 1
          • S Offline
            samson_82
            last edited by Feb 2, 2020, 9:49 AM

            wow. did not see this ^^.

            Use nano or a remote desktop to edit your config.

            1 Reply Last reply Reply Quote 0
            • M Offline
              Mykle1 Project Sponsor Module Developer @wazscience
              last edited by Feb 2, 2020, 4:27 PM

              @wazscience said in keep getting error after modifying config.js file:

              whenever I try to modify the config.js file, either to add a module or to edit an existing one, I get an error message

              You might want to give this a read. I went through the same thing as you.

              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 2
              • 1 / 1
              1 / 1
              • First post
                6/6
                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