When following the Magic Mirror manual install, I could across this issue:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@6.14.4
3 info using node@v10.21.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle magicmirror@2.11.0~prestart: magicmirror@2.11.0
6 info lifecycle magicmirror@2.11.0~start: magicmirror@2.11.0
7 verbose lifecycle magicmirror@2.11.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle magicmirror@2.11.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/MagicMirror/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
9 verbose lifecycle magicmirror@2.11.0~start: CWD: /home/pi/MagicMirror
10 silly lifecycle magicmirror@2.11.0~start: Args: [ '-c',
10 silly lifecycle 'DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js' ]
11 info lifecycle magicmirror@2.11.0~start: Failed to exec start script
12 verbose stack Error: magicmirror@2.11.0 start: `DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:198:13)
12 verbose stack at maybeClose (internal/child_process.js:982:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
13 verbose pkgid magicmirror@2.11.0
14 verbose cwd /home/pi/MagicMirror
15 verbose Linux 4.19.118-v7+
16 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
17 verbose node v10.21.0
18 verbose npm v6.14.4
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error magicmirror@2.11.0 start: `DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js`
23 error spawn ENOENT
24 error Failed at the magicmirror@2.11.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
When following the Magic Mirror manual install by Sam, I have this log:
install starting - Thu Jun 25 14:09:52 EDT 2020
installing on armv7l processor system
the os is Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster
[96mUpdating packages ...[90m
Hit:1 http://archive.raspberrypi.org/debian buster InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease Hit:3 https://deb.nodesource.com/node_10.x buster InRelease Reading package lists...
apt-get update completed ok
apt-get upgrade started
apt upgrade result =rc=0 Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following package was automatically installed and is no longer required:
rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[96mInstalling helper tools ...[90m
Reading package lists...
Building dependency tree...
Reading state information...
build-essential is already the newest version (12.6).
curl is already the newest version (7.64.0-4+deb10u1).
git is already the newest version (1:2.20.1-2+deb10u3).
unzip is already the newest version (6.0-23+deb10u1).
wget is already the newest version (1.20.1-1.1).
wget set to manually installed.
The following package was automatically installed and is no longer required:
rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[96mCheck current Node installation ...[0m
[0mNode currently installed. Checking version number.
[0mMinimum Node version: [1mv10.1.0[0m
[0mInstalled Node version: [1mv10.21.0[0m
[92mNo Node.js upgrade necessary.[0m
[96mCheck current NPM installation ...[0m
[0mNPM currently installed. Checking version number.
[0mMinimum npm version: [1mV6.0.0[0m
[0mInstalled npm version: [1mV6.14.4[0m
[92mNo npm upgrade necessary.[0m
[96mCloning MagicMirror ...[90m
[92mCloning MagicMirror Done![90m
[96mInstalling dependencies ...[90m
> electron-chromedriver@6.0.0 install /home/pi/MagicMirror/node_modules/electron-chromedriver
> node ./download-chromedriver.js
> core-js@2.6.11 postinstall /home/pi/MagicMirror/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
[96mThank you for using core-js ([94m https://github.com/zloirock/core-js [96m) for polyfilling JavaScript standard library![0m
[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: [0m
[96m>[94m https://opencollective.com/core-js [0m
[96m>[94m https://www.patreon.com/zloirock [0m
[96mAlso, the author of core-js ([94m https://github.com/zloirock [96m) is looking for a good job -)[0m
+ eslint@7.3.1
added 481 packages from 769 contributors and audited 775 packages in 63.015s
25 packages are looking for funding
run `npm fund` for details
found 3 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
[92mDependencies installation Done![90m
fixing sandbox permissions
setting up initial config.js
[96mCheck plymouth installation ...[0m
[93mplymouth is not installed.[0m
install and setup pm2
pm2 not installed, installing
pm2 install result /usr/bin/pm2 -> /usr/lib/node_modules/pm2/bin/pm2 /usr/bin/pm2-dev -> /usr/lib/node_modules/pm2/bin/pm2-dev /usr/bin/pm2-docker -> /usr/lib/node_modules/pm2/bin/pm2-docker /usr/bin/pm2-runtime -> /usr/lib/node_modules/pm2/bin/pm2-runtime npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/pm2/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"}) + pm2@4.4.0 added 185 packages from 191 contributors in 32.831s
get the pm2 platform specific startup command
startup command = sudo env PATH=$PATH:/usr/bin:/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
-------------
__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
_\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
_\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
_\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
_\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
_\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
_\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
_\///______________\///______________\///__\///////////////__
Runtime Edition
PM2 is a Production Process Manager for Node.js applications
with a built-in Load Balancer.
Start and Daemonize any application:
$ pm2 start app.js
Load Balance 4 instances of api.js:
$ pm2 start api.js -i 4
Monitor in production:
$ pm2 monitor
Make pm2 auto-boot at server restart:
$ pm2 startup
To go further checkout:
http://pm2.io/
-------------
[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target
[Service]
Type=forking
User=pi
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=$PATH:/usr/bin:/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/pi/.pm2
PIDFile=/home/pi/.pm2/pm2.pid
Restart=on-failure
ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill
[Install]
WantedBy=multi-user.target
Target path
/etc/systemd/system/pm2-pi.service
Command list
[ 'systemctl enable pm2-pi' ]
[PM2] Writing init configuration in /etc/systemd/system/pm2-pi.service
[PM2] Making script booting at startup...
[PM2] [-] Executing: systemctl enable pm2-pi...
[PM2] [v] Command successfully executed.
+---------------------------------------+
[PM2] Freeze a process list on reboot via:
$ pm2 save
[PM2] Remove init script via:
$ pm2 unstartup systemd
pm2 startup command done
configure the pm2 config file for MagicMirror
start MagicMirror via pm2 now
save MagicMirror pm2 config now
stop MagicMirror via pm2 now
[92mWe're ready! Run [1m[97mpm2 start MagicMirror[0m[92m from the ~/MagicMirror directory to start your MagicMirror.[0m
install completed - Thu Jun 25 14:15:09 EDT 2020
Could someone mention what I am doing wrong?