Npm -v problem with RPI3

Hi
please advise for the below :
npm -v
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version CXXABI_1.3.9' not found (required by node) node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by node)

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

I got as below 
![Capture|557x500](upload://qPiHlOqbLB5rcVLSWBLFDDRiKP1.png)

This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Remove old version of Node.js       ✔   
  Install Node.js 14 LTS              ✘   Bad install:  Node.js missing  Npm missing - Exit cache                     
  Install Node-RED core               
  Move global nodes to local          
  Npm rebuild existing nodes          
  Install extra Pi nodes              
  Add shortcut commands               
  Update systemd script               
                                      

Any errors will be logged to   /var/log/nodered-install.log

 
how can this be solved ?

What hardware/OS are you running on?

Edit: Also please post the install log found at /var/log/node-red-install.log

Also did you see the requirement to also run this before running the install script
sudo apt install build-essential git curl

please see below
sudo apt install build-essential git curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
curl is already the newest version.
git is already the newest version.
git set to manually installed.
The following packages were automatically installed and are no longer required:
libc-ares2 libv8-3.14.5
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 316 not upgraded.

for the log I got
/var/log/node-red-install.log
bash: /var/log/node-red-install.log: No such file or directory

Did you look to see if I might have mistyped it? Also when you ran the script it would have told you it is /var/log/nodered-install.log

Also you have not told us what OS you are running.

Try
sudo apt install libstdc++6
though how that would not be installed I don't know.

for log file I dont know what is the correct command to get the log

for the second command as below

sudo apt install libstdc++6
Reading package lists... Done
Building dependency tree
Reading state information... Done
libstdc++6 is already the newest version.
The following packages were automatically installed and are no longer required:
libc-ares2 libv8-3.14.5
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 303 not upgraded.

also please see the below
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
e[2 q

This script checks the version of node.js installed is 12 or greater. It will try to
install node 14 if none is found. It can optionally install node 12 LTS or 14 LTS for you.

If necessary it will then remove the old core of Node-RED, before then installing the latest
version. You can also optionally specify the version required.

It also tries to run 'npm rebuild' to refresh any extra nodes you have installed
that may have a native binary component. While this normally works ok, you need
to check that it succeeds for your combination of installed nodes.

To do all this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
If in doubt please backup your SD card first.

See the optional parameters by re-running this command with --help

Are you really sure you want to do this ? [y/N] ? y

Would you like to install the Pi-specific nodes ? [y/N] ? y
e[3;J

Running Node-RED install for user pi at /home/pi on raspbian

This can take 20-30 minutes on the slower Pi versions - please wait.

Stop Node-RED :heavy_check_mark:
Remove old version of Node-RED :heavy_check_mark:
Remove old version of Node.js :heavy_check_mark:
Install Node.js 14 LTS ✘ Bad install: Node.js missing Npm missing - Exit cache
Install Node-RED core
Move global nodes to local
Npm rebuild existing nodes
Install extra Pi nodes
Add shortcut commands
Update systemd script

Any errors will be logged to /var/log/nodered-install.log

pi@pi:~ $ /var/log/nodered-install.log
bash: /var/log/nodered-install.log: Permission denied
pi@pi:~ $

By just typing the logfile name you are effectively asking Bash to execute it and it's not executable.
To see the contents use
cat /var/log/nodered-install.log

You have masses of out of date software, and you still haven't told us what OS you are running. It might be Raspbian Buster for example.
To fetch the latest versions of the system s/w run
sudo apt update && sudo apt dist-upgrade
sudo apt update && sudo apt full-upgrade
There is a chance that might fix it.

Also what model of Pi3?

Edit: corrected command to bring the system up to date

Do you have n or nvm installed? These often cause an issue with node-red installation.

Open a terminal, try entering n -v and nvm -v - what do you get?

log.txt (40.4 KB)
log file attached

nvm -v
bash: nvm: command not found
pi@pi:~ $ n -v
bash: n: command not found
pi@pi:~ $

it is raspbian jessie
the board is RPI3

In the log is
The following packages have unmet dependencies:
nodejs : Depends: libstdc++6 (>= 5.2) but 4.9.2-10 is to be installed
E: Unable to correct problems, you have held broken packages.

That is probably because you have many out of date packages on your system. The solution is to run
sudo apt update && sudo apt full-upgrade

Then run
sudo apt install -f
which should fix the failed installs, then run the script again.

please see below
sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libc-ares2 libv8-3.14.5 pix-icons pix-plym-splash pixel-wallpaper
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

and

sudo apt install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
nodejs : Depends: libstdc++6 (>= 5.2) but 4.9.2-10+deb8u2 is to be installed
E: Unable to correct problems, you have held broken packages.

take a look on last try
new.txt (21.7 KB)

is there any other os can run nodered in proper way better than the one that I have now ?
if there is please post the link

Yes. Get the latest version of RaspinOS from the pi website. (Buster). Jessie went out of support a while back.

this can run old node red smoothly ?

Yes. @dceejay is right, nodejs 12 and above are no longer installable on Jessie and node-red now needs at least 12, so you need Buster.

It is a pain because it means I can't update node-red one of my PIs without doing a complete rebuild of the SD card using Buster.