Read the statement by Michael Teeuw here.
new update/upgrade script, ready for testing
-
I rebooted, and for some reason, MM didn’t restart right away, so I ran the script . It got further but then has an issue upgrading npm
-
@gonzonia sheesh, SO much fun… nodejs says is works and use this process…
we asked for node 20 and got something which turned into node 12…
(but then it doesn’t)I JUST tested this on the latest raspian 64bit… (june this year)
can you post output of these two commands
uname -a
lsb_release -a -
@sdetweil I found the this thread and I tired running with “force” but I’m getting the same issue when it tries to update npm.
pi@MagicMirror2:~/MagicMirror $ uname -a Linux MagicMirror2 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
pi@MagicMirror2:~/MagicMirror $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye
-
@gonzonia lets try this
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/uninstall_node.sh)"
this should remove node
so node -v should fail
then lets manually install node20
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/node20_install.sh)"
then check node version
node -v -
@sdetweil said in new update/upgrade script, ready for testing:
bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/uninstall_node.sh)”
pi@MagicMirror2:~/MagicMirror $ bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/uninstall_node.sh)" Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libc-ares2 libjs-highlight.js Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: nodejs* 0 upgraded, 0 newly installed, 1 to remove and 20 not upgraded. After this operation, 183 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 112341 files and directories currently installed.) Removing nodejs (20.5.1-deb-1nodesource1) ... dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/which/bin' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/text-table' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/tar/lib' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/semver/bin' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/rimraf' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/retry' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/read' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/read-package-json' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/once' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/npmlog' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/npm-user-validate' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/npm-install-checks' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/nopt' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/mkdirp/bin' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/minimatch' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/lru-cache' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/init-package-json' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/ini' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/inherits' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/inflight' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/graceful-fs' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/glob' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/columnify' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/cmd-shim' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/chownr' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/archy' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/abbrev' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/man/man7' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/man/man5' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/man/man1' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/lib/utils/completion' not empty so not removed dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/bin' not empty so not removed Processing triggers for man-db (2.9.4-2) ... pi@MagicMirror2:~/MagicMirror $ bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/node20_install.sh)" Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'nodejs' is not installed, so not removed The following packages were automatically installed and are no longer required: libc-ares2 libjs-highlight.js Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded. rm: cannot remove '/etc/apt/sources.list.d/nodesource.list': No such file or directory Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done ca-certificates is already the newest version (20210119). curl is already the newest version (7.74.0-1.3+deb11u7). gnupg is already the newest version (2.2.27-2+deb11u2). The following packages were automatically installed and are no longer required: libc-ares2 libjs-highlight.js Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded. deb [arch=arm64 signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main Get:1 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB] Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease Hit:3 http://archive.raspberrypi.org/debian bullseye InRelease Get:4 https://deb.nodesource.com/node_20.x nodistro/main arm64 Packages [3,264 B] Fetched 15.4 kB in 1s (12.8 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libnode72 nodejs-doc Suggested packages: npm The following NEW packages will be installed: libnode72 nodejs nodejs-doc 0 upgraded, 3 newly installed, 0 to remove and 20 not upgraded. Need to get 0 B/9,956 kB of archives. After this operation, 43.3 MB of additional disk space will be used. Selecting previously unselected package libnode72:armhf. (Reading database ... 106718 files and directories currently installed.) Preparing to unpack .../libnode72_12.22.12~dfsg-1~deb11u4_armhf.deb ... Unpacking libnode72:armhf (12.22.12~dfsg-1~deb11u4) ... Selecting previously unselected package nodejs. Preparing to unpack .../nodejs_12.22.12~dfsg-1~deb11u4_armhf.deb ... Unpacking nodejs (12.22.12~dfsg-1~deb11u4) ... Selecting previously unselected package nodejs-doc. Preparing to unpack .../nodejs-doc_12.22.12~dfsg-1~deb11u4_all.deb ... Unpacking nodejs-doc (12.22.12~dfsg-1~deb11u4) ... Setting up libnode72:armhf (12.22.12~dfsg-1~deb11u4) ... Setting up nodejs-doc (12.22.12~dfsg-1~deb11u4) ... Setting up nodejs (12.22.12~dfsg-1~deb11u4) ... Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) ... Processing triggers for man-db (2.9.4-2) ... pi@MagicMirror2:~/MagicMirror $ node -v v12.22.12 pi@MagicMirror2:~/MagicMirror $
Why is it installing 12 .22.12???
-
@gonzonia said in new update/upgrade script, ready for testing:
Why is it installing 12 .22.12???
cause somebody is confused…
so, lets try this
do the remove again
then do
sudo rm -rf /usr/lib/node_modules/npm
and test
node -v
npm -vboth should fail
command not foundplease confirm, if true then do the install command again
otherwise don’t continue
-
Same result
pi@MagicMirror2:~/MagicMirror $ bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/uninstall_node.sh)" Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libc-ares2 libjs-highlight.js libnode72 nodejs-doc Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: nodejs* 0 upgraded, 0 newly installed, 1 to remove and 20 not upgraded. After this operation, 919 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 106969 files and directories currently installed.) Removing nodejs (12.22.12~dfsg-1~deb11u4) ... Processing triggers for man-db (2.9.4-2) ... pi@MagicMirror2:~/MagicMirror $ sudo rm -rf /usr/lib/node_modules/npm pi@MagicMirror2:~/MagicMirror $ node -v -bash: /usr/bin/node: No such file or directory pi@MagicMirror2:~/MagicMirror $ npm -v -bash: /usr/bin/npm: No such file or directory pi@MagicMirror2:~/MagicMirror $ bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/node20_install.sh)" Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'nodejs' is not installed, so not removed The following packages were automatically installed and are no longer required: libc-ares2 libjs-highlight.js libnode72 nodejs-doc Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded. rm: cannot remove '/etc/apt/sources.list.d/nodesource.list': No such file or directory Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done ca-certificates is already the newest version (20210119). curl is already the newest version (7.74.0-1.3+deb11u7). gnupg is already the newest version (2.2.27-2+deb11u2). The following packages were automatically installed and are no longer required: libc-ares2 libjs-highlight.js libnode72 nodejs-doc Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded. deb [arch=arm64 signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main Get:1 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB] Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease Hit:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease Get:4 https://deb.nodesource.com/node_20.x nodistro/main arm64 Packages [3,264 B] Fetched 15.4 kB in 1s (14.2 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done Suggested packages: npm The following NEW packages will be installed: nodejs 0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. Need to get 0 B/148 kB of archives. After this operation, 919 kB of additional disk space will be used. Selecting previously unselected package nodejs. (Reading database ... 106907 files and directories currently installed.) Preparing to unpack .../nodejs_12.22.12~dfsg-1~deb11u4_armhf.deb ... Unpacking nodejs (12.22.12~dfsg-1~deb11u4) ... Setting up nodejs (12.22.12~dfsg-1~deb11u4) ... update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode Processing triggers for man-db (2.9.4-2) ... pi@MagicMirror2:~/MagicMirror $ node -v v12.22.12 pi@MagicMirror2:~/MagicMirror $
-
@gonzonia SO much fun…
lets see if we can find that older version binary
cd / find . -type f 2>/dev/null | grep -i nodejs_12.22.12
-
@sdetweil said in new update/upgrade script, ready for testing:
find . -type f 2>/dev/null | grep -i nodejs_12.22.12
I had a similar thought and ran just before you said that. I removed node and ran
sudo apt-get clean
Running the find after came back empty.
I tried installing again. Same result.
Now the find shows
pi@MagicMirror2:/ $ node -v v12.22.12 pi@MagicMirror2:/ $ find . -type f 2>/dev/null | grep -i nodejs_12.22.12 ./var/cache/apt/archives/nodejs_12.22.12~dfsg-1~deb11u4_armhf.deb
-
@gonzonia ok, I am trying to flash that OS version… but I don’t see Apr 3 2023… I see feb 21 2023…