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.

    Add JS Code to the Mirror

    Scheduled Pinned Locked Moved Solved Troubleshooting
    33 Posts 5 Posters 12.2k Views 5 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.
    • D Offline
      dnj0104
      last edited by

      I added your code snippet in 1st line after

      var mpd = require('mpd'),
      

      and output

      [2020-10-24 01:56:54.490] [ERROR]  WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/modules/mpd_client/node_helper.js:1
      var mpd = require('mpd'),const NodeHelper = require("node_helper");
                               ^^^^^
      
      SyntaxError: Unexpected token const
          at Module._compile (internal/modules/cjs/loader.js:722:23)
          at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
          at Module.load (internal/modules/cjs/loader.js:645:32)
          at Function.Module._load (internal/modules/cjs/loader.js:560:12)
          at Module.require (internal/modules/cjs/loader.js:685:19)
          at require (internal/modules/cjs/helpers.js:16:16)
          at loadModule (/home/pi/MagicMirror/js/app.js:134:17)
          at loadNextModule (/home/pi/MagicMirror/js/app.js:169:5)
          at /home/pi/MagicMirror/js/app.js:171:6
          at Class.loaded (/home/pi/MagicMirror/js/node_helper.js:18:3)
      
      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @dnj0104
        last edited by

        @dnj0104 no, I want it to be a line BEFORE the stuff in the file already

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          AH! Sorry!

          Changed it now your snippet in 1st Line

          And we have Success!!! Finally!!

          Thanks Alot @sdetweil

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