Read the statement by Michael Teeuw here.
Starting MM Crontab
-
@mumblebaj did you use npm start before?
it ‘may’ be the path as @KristjanESPERANTO mentioned
so from the user command line do
which node
and use that result in the cron command
-
@sdetweil Hi Sam. I have always used npm. I have just been reading through the PR-3764 and i agree with your arguments in that it could have breaking affects for how we do things as both users and devs. Case in point.
However, the forum is about new things and moving forward, so I agree with @KristjanESPERANTO on that point of view as well.
I have now resolved my script issue and am now able to launch from the cron again. 😉
For somebody who may have the same issue, this is how I solved for it.
export DISPLAY=:0 cd ~/MagicMirror npm run start:x11
The above has solved it for me now.
-
@sdetweil Stupid question, how do I mark this as resolved?
-
@mumblebaj you didn’t open it as an issue, so it can’t be resolved
Normally 3 dot menu right of selected post
-
@mumblebaj what do you think fixed your problem?
DISPLAY is set in package.json if not already
folder of course -
@sdetweil A few things:
The main issue being:
MagicMirror is now using a flat npm config, and the start scripts are handled differently,node --run start:x11
is not a valid Node.js command — unless you are using a custom wrapper or an internal script, this will fail silently or do nothing.As Crontab runs in a minimal environment, so any graphical (X11) application must explicitly export DISPLAY. Previously I had the command as
DISPLAY=:0 npm start
. Now, I had toexport DISPLAY=:0
first and then start MM.