Update Node.js 12.22.12 to latest version question

Hi,

I have a Raspberry Pi (3b with Raspian Buster) running Node-Red.
Some Nodes which I use in my flows need an update.
However Node.js is still on version 12.22.12 and to update these Nodes to latest version I need Node.js >14.

So I performed a command which I already used succesfully on my other Pi (3B+ with Raspian Buster):

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16

But after the installation was finished the screen showed me the following info:

Node.js is not updated to v16

What may cause this?

Check that this command (to update all packages on your system to the latest) works. I suspect it may fail.
sudo apt update && sudo apt full-upgrade

I performed before the update:

sudo apt-get update; sudo apt-get upgrade

Should this be sufficient?

You should use full-upgrade, but usually it doesn't make any difference.
Did you check that both the update and the upgrade worked without error?

If they did succeed then there may be more information in the install log that is mentioned at the end of the install, /var/log/nodered-install.log. See if there are any errors in that. If you can't see the problem then post the log here. When pasting it in use the </> button at the top of the forum entry window to stop the forum from interpreting the text as markdown.

I am now performing the Pi update/upgrade using your command.
But this is the LOG before your command. It is (sadly) in Dutch
I guess there are errors, but my knowledge is to poor to figure out what the errors mean.
The log is too large to post as HTML text, therefor I have uploaded the TXT file

nodered-install.log (94.2 KB)

These messages in the LOG suggest that node 16 is not properly installed:
dpkg: waarschuwing: verzoek om nodejs te verwijderen wordt genegeerd omdat het niet geĂŻnstalleerd is
dpkg: waarschuwing: verzoek om node te verwijderen wordt genegeerd omdat het niet geĂŻnstalleerd is

Translation to english:
dpkg: warning: request to remove nodejs ignored because it is not installed
dpkg: warning: request to remove node ignored because it is not installed

This is the important bit

+ apt-get update
Ophalen:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15,0 kB]
Geraakt:2 https://deb.nodesource.com/node_12.x buster InRelease
Ophalen:3 http://archive.raspberrypi.org/debian buster InRelease [32,6 kB]
Pakketlijsten worden ingelezen...
E: Bij pakketbron 'http://raspbian.raspberrypi.org/raspbian buster InRelease' is de 'Suite'-waarde gewijzigd van 'stable' naar 'oldstable'
E: Bij pakketbron 'http://archive.raspberrypi.org/debian buster InRelease' is de 'Suite'-waarde gewijzigd van 'testing' naar 'oldstable'
Error executing command, exiting

As I suspected, the sudo apt update command is failing. You need to fix that first.
It looks like it may be Resolve apt update problem on raspberry pi: “This must be accepted explicitly before updates for this repository…” | {“title”: “Who let the dogs out”} in which case the solution there may fix it.

The Pi is still updating (17%) the command: sudo apt update && sudo apt full-upgrade

So I have to wait untill I can run the possible fix in the link you send me: sudo apt-get update --allow-releaseinfo-change
And then re-run sudo apt update && sudo apt full-upgrade again I guess?

I am surprised the full-upgrade part of the command is running if the update part failed. Also you said you had run it but using upgrade rather than full-upgrade, and there should be no or very little difference in what is done, so I am surprised it is now updating. The difference between using ; and && is just that using && prevents the upgrade from running if the update failed, but using just ; tells it to run the second part even if the first fails, which is pointless.
Did the update part of that command work without showing the errors that were in the log?

I can't see that part anymore, can't scroll back this far....still unzipping packages 48%
Is there also a log when sudo apt update && sudo apt full-upgrade is performed?

I don't know.
When it is complete just run it again and make sure there are no errors shown.

Is it working now?

I have not looked lately Colin, as soon as I have time again i'll let you know. I used ssh to connect and I didnt wait till it was finished.
Thanx for the interest.

Hey Colin, the update to node.js version 16 worked!

image

Apparently your update/upgrade command worked better than the one I used before.
Thanx for the help

Hi Colin,

2 weeks after my succesfull update to node.js version 16, my SD card with raspbian buster is suddenly full.

image

Before I never had this issue.
What can be the issue....and how to solve it?

Install ncdu
apt install ncdu
Then run
sudo ncdu /
and it will tell you where the large files are.

This command will tell you which directories in root are taking up the space:

sudo du -sm /* 2>/dev/null | sort -n

I see:
0 /bin
0 /dev
...
4 /tmp
4 /etc
31 /boot
106 /root
1602 /usr
2021 /var
2692 /home
(/home takes up 2.7GB, /var takes up 2GB)

If your /var looks too big you can run it again to see the largest directories and files in /var

sudo du -sm /var/* 2>/dev/null | sort -n

A common cause of filling up a Pi root filesystem is runaway logfiles in /var/log

ls -lrt /var/log

A fairly safe way to free up disc space:

sudo rm -f /var/log/*.gz

ps Do please be careful using sudo rm together with wildcards!

I had the same issue last June'22 trying to update 'node.js' and Node-RED.

I've just tried the suggestion (given in Colin's link above) & repeated below and can report it worked for me.

I found last week the large files in /var/log/
the deamon.log and syslog were huge together 6gb.

Today I looked again and there was a 6.1Gb deamon.log.1 file and the deamon.log was already 1.9Gb.
So I removed the deamon.log.1 file (last date was 3 days ago)

I encounter this issue since I updated node.js to v16
But I wonder why these log files grow so large and are not automatically deleted?

With crontab -e, I reset this Raspberry Pi (Buster) every day at 4.00 AM (but that is already running a few years). I thought that after a reboot the log files would automatically be deleted?

What does this command show?
ls -l /var/log/syslog*

image

And here my daemons :wink:
image

daemon.log already went from 1.9Gb to 2.1Gb in 1 hour
I have downloaded the file to my WIN10 PC to view with a text editor but 2gb is running out of mem.