Install erroring out GLIBCXX_3.4.26 not found

I am trying to install the latest version of Node-Red using the Raspberry Pi instructions using the command:
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

I get a bad install on the Node.js 20 update.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Using N to manage Node.js           +
  Update Node.js 20                   ✘   Bad install:  Node.js missing  Npm missing - Exit cache  

What could I try to resolve this?

The log shows this:

Started : Tue 07 Jan 2025 12:04:26 PM EST
Running for user pi at /home/pi
Found global nodes:   :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Using n
     copying : node/20.18.1
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
/usr/local/bin/node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/bin/node)
   installed :  (with npm )

Versions: node:missing npm:missing

EDIT: I am running the Buster OS on the Raspberry Pi and came across something suiggesting this is the issue. Can anyone confirm this or suggest an upgrade path?

You seem to be using the n version manager for node.js. This is generally a poor experience because every time you change version, you loose every node.js package you had installed.

Best to get rid of n.

Is that something which is in the script supplied in the the Raspberry Pi instructions? Sorry, I am ignorant to most of the npm installations.

No, we generally recommend that people don't use node version managers.

Probably best for you to remove n with sudo npm remove -g n.

Then you should be able to run the script again I think.

Yes,this situation is not funny at all

Happened to me as well, trying to run the script to upgrade an RPi4 that was still running rather old versions (node 16.16.0 and NR 3.0.1)

The script failed completely and destroyed my setups, making everything unusable. Got the same error message as above. Tried a lot to install node etc but nothing helped

Lucky I was anyway, since on all my RPi's I have a small SD reader and an additional SD card having a fresh backup. Just swapping SD cards and I was up running again (quickly starting making a new SD card copy to be prepared)

But now, what is the correct steps to take? Running the script again is a no-go. I believe I should update node to a higher version, to prevent the script from touching that part

But what are the recommended steps now to follow??

I will start by making it clear that this is just my opinion - make of it what you will.

But I always prefer to take control of software installations even if that means a bit more work up-front understanding things.

I think that this is a good illustrative point. It is easy enough to get into a mess by following someone else's install script without understanding the possible edge-cases.

Dave's Debian/Rasbian install script is a work of art, to be sure! But no script can ever cover all the possibilities.

My personal recommendation to you would be to:

  • Make sure you have a current backup of your ~/.node-red folder.
  • Stop & disable Node-RED (something like sudo systemctrl disable node-red)
  • Delete the ~/.node-red/node-modules/ folder.
  • Uninstall node-red (npm -g remove node-red) and any other related global installs.
  • Remove any nodejs version managers like n.
  • Remove any remaining traces of node.js installations.

Now you should have a fairly clean baseline.

  • Update your OS
  • Install node.js LTS - from the community maintained debian nodejs repository, not from the actual Debian repo. This will be maintained simply with an OS update.
  • Then install Node-RED and any other dependencies you need.
  • Go into ~/.node-red/ folder and do an npm install. Check for any errors and correct them.
  • Run npm outdated and then npm update or other installs to get all of your nodes to the current versions.
  • Now you should be able to enable and start node-red again via systemctrl

From then on, you simply need to periodically run sudo apt update && sudo apt upgrade, run npm update in ~/.node-red/, do a sudo npm -g update.

Check that everything is working OK and then do a new backup.

After that you should be knowledgeable enough to be able to manage things even if you get an odd error for some reason. At least you will know all of the main moving parts and how to update/reinstall them all.

It is also a great idea to read through Dave's install script as you are doing all this so that you understand all the bits.

The maintenance of node-red and its components this way, while it may look complex in writing, is actually only a few steps, easily done.

Excellent as always, thanks @TotallyInformation

I will try this as soon my SD card copy has finished, making me confident, enough to try!

systemctl not systemctrl - I always get that wrong! :smile:

BTW, I always put the commands as npm scripts in my package.json - saves me having to remember them all.

And I go further since I don't install Node-RED globally - my alternate installer repo has more detail if you want to go that way.

Most likely all you had do to was to fully remove n and run the script again.

I'm for sure willing to re-do the trial now that I have recovered the thing and made a new SD card copy, basically back where I started. But I would really like to follow the exact steps to reproduce so we know exactly what and in what order we should do things

I think it all went wrong when I added --node20 to the end of the script, upgrading of node then failed

NR version 3.0.1 and Node 16.16.0

The script stops since the node version is too old. I see that I have n installed but nvm is not

The following seems to be the first steps to do. Is that all and then try the script again?

  • Remove any nodejs version managers like n.
  • Remove any remaining traces of node.js installations.
sudo n prune
sudo npm uninstall -g n
sudo rm -r /usr/local/n
sudo rm /usr/local/bin/node 

Yes, then make sure that
node -v
Says command not found.

I wonder whether it would be better if the script refused to run if n or nvm is in use.

1 Like

I'm tending to agree...

So just reporting my progress here, it is working fine now, NR 4.0.8 and Node 18.20.5
(PRETTY_NAME="Raspbian GNU/Linux 10 (buster)")

Before I did run the script this time, here are the steps I followed. After this the script worked brilliantly

  1. sudo npm uninstall -g n
    I got a warning about the flag was depriciated so next
  2. sudo npm uninstall --location=global n
    n was however still there as well as the current installed node version
  3. sudo n prune
    n and node still there...
  4. sudo rm -r /usr/local/n
  5. sudo rm /usr/local/bin/node
    n still there...but where is it installed
  6. which n
  7. sudo rm -r /usr/bin/n
    now n and node was finally removed

After this I installed using the script with --node18 as param, worked fine

Darn it, n is like that politician that really should go away but keeps getting elected! :smile:

1 Like

I had to update the OS on my Raspberry Pi from Buster. I went to the latest and was able to install. Until I managed that, other options did not help.

How did you update the OS?

Decided to make shot at one of my other RPi3's, running on the same old stuff

Followed the steps outlined above and the script worked perfect, upgraded to NR 4.0.8 and Node 18.20.5 in 8 minutes

Next, I have a couple of RPi3's left, still running even older versions of NR, will try to do the same with them

1 Like

Now upgraded a number of RPi3's, running NR 2.2.2 and Node 16.16.0

Used the script directly since neither n or nvm was installed in those. Now running NR 4.0.8 and Node 18.20.5, working perfectly fine, all my units now running the latest

The problem with upgrading seems to be related to n. When n was installed, the script did not work for me, I did the above steps first. It seems, if n is not installed, the script handles the upgrade fine

Wonder why n was installed and where it came from since my older RPi3's didn't have them installed??

1 Like

Just an additional note about all this with too old node versions...

If you are on an older (Linux) distribution on some of your computers it might be they do not support node versions from version 18 and higher. Means you will also not be able to upgrade Node-RED to later version

You basically have 3 options:

  1. Upgrade your operating system
  2. Stay on your current os version and instead build, compile and install your own version of glibc v2.28 and patch node. If successful, after this you can upgrade Node-RED
  3. Do nothing and stay on a Node-RED version that still supports Node up to version 17

In my case, in addition to all the various RPi's, I have

  • NVIDIA Jetson Nano, running Ubuntu 18 w Node version 16
  • an old Lenovo laptop running Debian 9 w Node version 16

I felt alternative 2) would be the first thing to try. I found a nice guide here

Only thing missing in the guide where some additional steps:

cd glibc-2.28
mkdir glibc-build
cd glibc-build
../configure --prefix=/opt/glibc-2.28
make -j 4 # Use all 4 Jetson Nano cores for much faster building
make install

This worked successfully on my NVIDIA device, now it is upgraded and runs Node-RED 4.0.8 and Node version 20.18.1

On my laptop, I have so far failed. I have changed to the correct architecture x86_64 but the patching seems not to work (yet).

2 Likes

Are you sure the script does not work with Debian 9 (Stretch)? What happened when you tried it?