Read the statement by Michael Teeuw here.
fixuppm2.sh
-
@sdetweil
pi@MagicMirror:~ $ bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)”
the log will be saved in /home/pi/MagicMirror/installers/pm2_setup.log
sudo: npm: command not found
bash: linje 127: pm2: command not found
bash: linje 211: pm2: command not found
bash: linje 214: pm2: command not found
pi@MagicMirror:~ $ npm -v
11.6.2
pi@MagicMirror:~ $The log say
pm2 setup starting - tor okt 16 18:38:30 CEST 2025 using parameter bash system is Linux EmptyImage 6.12.47+rpt-rpi-v7 #1 SMP Raspbian 1:6.12.47-1+rpt1~bookworm (2025-09-16) armv7l GNU/Linux the os is Distributor ID: Raspbian Description: Raspbian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm node version v22.20.0 force installing latest npm version via npm npm version 10.9.3 pm2 not installed, installing get the pm2 platform specific startup command startup command = pm2 startup command done configure the pm2 config file for MagicMirror start MagicMirror via pm2 now save MagicMirror pm2 config now pm2 setup completed - tor okt 16 18:39:22 CEST 2025 pm2 setup starting - fre okt 17 13:46:28 CEST 2025 using parameter bash system is Linux MagicMirror 6.12.47+rpt-rpi-v7 #1 SMP Raspbian 1:6.12.47-1+rpt1~bookworm (2025-09-16) armv7l GNU/Linux the os is Distributor ID: Raspbian Description: Raspbian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm node version v22.20.0 force installing latest npm version via npm npm version 11.6.2 pm2 not installed, installing get the pm2 platform specific startup command startup command = pm2 startup command done configure the pm2 config file for MagicMirror start MagicMirror via pm2 now save MagicMirror pm2 config now pm2 setup completed - fre okt 17 13:46:29 CEST 2025i can install pm2 but only with “npm install -g pm2” and not “sudo npm install -g pm2”
-
@Assassins -g means it’s available globally across the system
You can execute it in every folder
AND globally means adding to the /usr folder tree which require root authority (sudo)Without means you have to be in the folder tree where you did npm install, AND If the install folder is NOT in the path, then you have to prefix pm2 with the correct path EVERY TIME
I think this also breaks boot time support which is the primary value, in my opinion
-
@sdetweil said in fixuppm2.sh:
@Assassins -g means it’s available globally across the system
You can execute it in every folder
AND globally means adding to the /usr folder tree which require root authority (sudo)Without means you have to be in the folder tree where you did npm install, AND If the install folder is NOT in the path, then you have to prefix pm2 with the correct path EVERY TIME
I think this also breaks boot time support which is the primary value, in my opinion
But your script works fine now that I have installed pm2
-
A Assassins has marked this topic as solved
-
@Assassins which script?
And how did you install it. -g or not -
@sdetweil said in fixuppm2.sh:
@Assassins which script?
bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)”
And how did you install it. -g or not
With -g
My second test was without -g and it works there too -
@Assassins weird
