Read the statement by Michael Teeuw here.
Can't edit compliments.js
-
Hello everyone
I’ve been using magic mirror for a few days now and have had no trouble editing config.js. I’ve been able to change the calendar from US to Australia, the news feed and the weather to my location here in Fawkner.
However each time I change the compliments.js and use ctrl o to save and then ctrl x to exit and then reboot the rpi no changes have been saved.
I have tried sudo nano compliments.js and still no luck. Do I need to stop the magicmirror service in order to edit the compliments.js?
What I want to do is add a few compliments and remove a couple.
-
@mayfield no. but.
don’t edit the source file. copy module setting to config.js… in this case the compliments object
in general, never edit the source files. the system is designed to take what is in config.js first.
-
@sdetweil said in Can't edit compliments.js:
@mayfield no. but.
don’t edit the source file. copy module setting to config.js… in this case the compliments object
in general, never edit the source files. the system is designed to take what is in config.js first.
Ok thanks for the tip I will do that 👍
-
I’ve been reading through the documentation from here https://docs.magicmirror.builders/modules/compliments.html#configuration-options
Each time I add this to the config it stops working I’m obviously missing something.
{ module: "compliments", position: "lower_third" config: { compliments: { anytime: [ "Hey Wren!" ], morning: [ "blah blah blah", "blah blah blah", "blah blah blah" ], afternoon: [ "blah blah blah", "Yblah blah blah", "blah blah blah" ], evening: [ "blah blah blah", "blah blah blah", "blah blah blah" ], "....-01-01": [ "Happy new year!" ] } } },
-
Hi @mayfield,
Most of the times, commas are missing (here at least after the line with the position). Use the builtin function to check if it is valid…I use a website where you can enter the whole content of your config.js:
https://esprima.org/demo/validate.htmlGreetings
Thomas -
-
@sdetweil I know:-)
-
@thgmirror typically ‘unexpected token’ means the line before was missing a trailing comma
-
@sdetweil said in Can't edit compliments.js:
@thgmirror the built-in checker is
from the MagicMirror folder do
npm run config:check
Yes this was going to be another question I wanted to ask as that doesn’t work on mine and I’m not sure why yet
I followed this site to flash a SD card https://github.com/guysoft/MagicMirrorOS
and when I run that I get this I guess I need to install that
-
ah mmos…
then u have to run the command inside the docker container where mm is installed