@sdetweil Here are the contents of the package.json and run-start.sh files. Note that I have not edited anything. This is exactly how they came from the installation process.
{
"name": "magicmirror",
"version": "2.27.0",
"description": "The open source modular smart mirror platform.",
"main": "js/electron.js",
"scripts": {
"start":"./run-start.sh $1",
"start":"./run-start.sh $1",
"server": "node ./serveronly",
"install-mm": "npm install --no-audit --no-fund --no-update-notifier --only=prod --omit=dev",
"install-mm:dev": "npm install --no-audit --no-fund --no-update-notifier",
"install-vendor": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error --no-audit --no-fund --no-update-notifier",
"install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier",
"postinstall": "npm run install-vendor && npm run install-fonts && echo \"MagicMirror² installation finished successfully! \n\"",
"test": "NODE_ENV=test jest -i --forceExit",
"test:coverage": "NODE_ENV=test jest --coverage -i --verbose false --forceExit",
"test:electron": "NODE_ENV=test jest --selectProjects electron -i --forceExit",
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit",
"test:unit": "NODE_ENV=test jest --selectProjects unit",
"test:prettier": "prettier . --check",
"test:js": "eslint .",
"test:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json",
"test:calendar": "node ./modules/default/calendar/debug.js",
"config:check": "node js/check_config.js",
"lint:prettier": "prettier . --write",
"lint:js": "eslint . --fix",
"lint:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json --fix",
"lint:staged": "lint-staged",
"prepare": "[ -f node_modules/.bin/husky ] && husky || echo no husky installed."
},
"repository": {
"type": "git",
"url": "https://github.com/MagicMirrorOrg/MagicMirror"
},
"keywords": [
"magic mirror",
"magicmirror",
"smart mirror",
"mirror UI",
"modular"
],
"author": "Michael Teeuw",
"contributors": [
"https://github.com/MagicMirrorOrg/MagicMirror/graphs/contributors"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
},
"homepage": "https://magicmirror.builders",
"devDependencies": {
"@stylistic/eslint-plugin": "^1.7.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jsdoc": "^48.2.2",
"eslint-plugin-package-json": "^0.12.1",
"eslint-plugin-unicorn": "^51.0.1",
"express-basic-auth": "^1.2.1",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jsdom": "^24.0.0",
"lint-staged": "^15.2.2",
"playwright": "^1.42.1",
"prettier": "^3.2.5",
"sinon": "^17.0.1",
"stylelint": "^16.3.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-prettier": "^5.0.0"
},
"optionalDependencies": {
"electron": "^29.1.6"
},
"dependencies": {
"ansis": "^2.3.0",
"console-stamp": "^3.1.2",
"envsub": "^4.1.0",
"eslint": "^8.57.0",
"express": "^4.19.2",
"express-ipfilter": "^1.3.2",
"feedme": "^2.0.2",
"helmet": "^7.1.0",
"html-to-text": "^9.0.5",
"iconv-lite": "^0.6.3",
"module-alias": "^2.2.3",
"moment": "^2.30.1",
"node-ical": "^0.18.0",
"pm2": "^5.3.1",
"socket.io": "^4.7.5",
"suncalc": "^1.9.0",
"systeminformation": "^5.22.6"
},
"lint-staged": {
"*": "prettier --write",
"*.js": "eslint --fix",
"*.css": "stylelint --fix"
},
"_moduleAliases": {
"node_helper": "js/node_helper.js",
"logger": "js/logger.js"
},
"engines": {
"node": ">=18"
}
}
And here is run-start.sh:
#!/bin/bash
# use bash instead of sh
# get the folder for this file
DIR=$(dirname "$0")
# make sure we are running in that folder
cd "$DIR" >/dev/null
# check for the old untrack css script
[ -f ./untrack-css.sh ] && ./untrack-css.sh
# if running under docker
if grep docker /proc/1/cgroup -qa; then
# only start electron
electron js/electron.js $1;
else
# not running in docker
if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
export DISPLAY=:0 # Set by default display
fi
# get the processor architecture
arch=$(uname -m)
false='false'
true='true'
# get the config option, if any
# only check non comment lines
serveronly=$(grep -v '^[[:blank:]]*//' config/config.js | grep -i serveronly: | tr -d ',"'\''\r' | tr -d ' ' | awk -F/ '{print $1}' | awk -F: '{print $2}')
# set default if not defined in config
serveronly=${serveronly:-false}
# check for xwindows running
while [ 1 -eq 1 ];
do
xorg=$(pgrep Xorg)
if [ "$xorg." == "." ]; then
# check for x on Lubuntu
xorg=$(pgrep X)
fi
# if user set wait_for_x to some value (ANY value)
if [ "$wait_for_x." != "." ]; then
if [ "$xorg." != "." ]; then
# then break from loop
break;
else
# sleep for 1 second
sleep 1
fi
else
# exit loop, not waiting, default
break;
fi
done
#check for macOS
mac=$(uname)
el_installed=$true
if [ ! -d node_modules/electron ]; then
el_installed=$false
fi
#
# if the user requested serveronly OR
# electron support for armv6l has been dropped OR
# system is in text mode
#
if [ "$serveronly." != "$false." -o "$arch" == "armv6l" -o "$arch" == "i686" -o $el_installed == $false ] || [ "$xorg." == "." -a $mac != 'Darwin' -a "$wait_for_x." != "." ]; then
t=$(ps -ef | grep "node serveronly" | grep -m1 -v color | awk '{print $2}')
if [ "$t." != '.' ]; then
sudo kill -9 $t >/dev/null 2>&1
fi
# if user explicitly configured to run server only (no ui local)
# OR there is no xwindows running, so no support for browser graphics
if [ "$serveronly." == "$true." ] || [ "$xorg." == "." -a $mac != 'Darwin' -a "$wait_for_x." != "." ]; then
# start server mode,
node serveronly
else
# start the server in the background
# wait for server to be ready
# need bash for this
exec 3< <(node serveronly)
# Read the output of server line by line until one line 'point your browser'
while read line; do
case "$line" in
*point\ your\ browser*)
echo $line
break
;;
*)
echo $line
#sleep .25
;;
esac
done <&3
# Close the file descriptor
#exec 3<&-
# lets use chrome to display here now
# get the server port address from the ready message
port=$(echo $line | awk -F\: '{print $4}')
# start chromium
# echo "Starting chromium browser now, have patience, it takes a minute"
# continue to spool stdout to console
tee <&3 &
if [ "$external_browser." == "." ]; then
# start chromium
echo "Starting chromium browser now, have patience, it takes a minute"
if [ $mac != 'Darwin' ]; then
b="chromium"
if [ $(which $b). == '.' -o $arch == 'armv6l' ]; then
b='chromium-browser'
fi
if [ $(which $b). != '.' ]; then
rm -rf ~/.config/$b 2>/dev/null
r=$(mktemp -d "${TMPDIR:-/tmp}"/tmp.XXXXXXXX)
"$b" -noerrdialogs -kiosk -start_maximized --new-window --site-per-process --no-zygote --no-sandbox --disable-infobars --app=http://localhost:$port --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors --user-data-dir=$r 2>/dev/null
rm -rf $r >/dev/null
else
echo "Chromium_browser not installed"
# if we can't start chrome,
# get the server process id
ns=$(ps -ef | grep "node serveronly" | grep -m1 -v color | awk '{print $2}')
# if we have the process id
if [ "$ns". != "." ]; then
# kill server for restart
sudo kill -9 $ns >/dev/null 2>&1
fi
fi
else
open -a "Google Chrome" http://localhost:$port --args -noerrdialogs -kiosk -start_maximized --disable-infobars --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null
fi
else
# if the external browser was specified
if [ "$(which $external_browser)." != "." ]; then
# launch it
case ${external_browser,,} in
midori )
# start midori
echo "Starting $external_browser browser now, have patience, it takes a minute"
"$external_browser" http://localhost:$port -e Fullscreen -e Navigationbar >/dev/null 2>&1
;;
firefox )
# start firefox
"$external_browser" http://localhost:$port -kiosk >/dev/null 2>&1
;;
surf )
# start surf
"$external_browser" -F http://localhost:$port >/dev/null 2>&1
;;
* )
#else
echo "don't know how to launch $external_browser"
esac
else
echo "couldn't locate $external_browser from the command shell,. check the PATH environment variable"
fi
fi
exit
fi
else
# we can use electron directly
node_modules/.bin/electron js/electron.js $1;
fi
fi