Install nodejs 12 on Raspbian Jessie

I want to install nodejs 12 on Raspbian Jessie on a Pi 3 currently running v10.x. I uninstalled nodejs using apt and then ran the pi install script, but it installed 10.x again. Is it not possible to install 12 on Jessie?
I know I should upgrade to Buster, it is on the todo list but this pi has a complex setup so that is not a trivial task, I was hoping to keep it going until I have more time.

I wouldn’t update your pi to Buster for a while yet. It is a big upgrade and changes quite a few things.

To get nodejs 12. I would follow the standard approach which is linked from the node downloads page. Add the maintained sources library and install/update via apt.

I tried that first, assuming you mean the instructions at
I get

nodejs : Depends: libstdc++6 (>= 5.2) but 4.9.2-10+deb8u2 is to be installed

I searched around but could not find anything helpful. I found a thread here with someone having that problem with the node-red script which resulted in a fixed script, but perhaps the fix was just to limit it to 10.x

I have updated several pis to Buster over the last few months and encountered no problems so far.

@Colin - instead of uninstalling you could try to edit /etc/apt/source.list.d/nodesource.list - to point to 12.
eg deb jessie main then apt-get update / upgrade should pull it in

That is what I now have there, that gives the dependency problem on install or upgrade.
Taken at face value the error is saying the node 12.x in the jessie repository requires libstdc++6 5.2 or higher, but the version in the jessie repo is 4.9 (which it is).
I will try on one of my other Jessies to check it is not something specific to this system.

[Edit] No I won't, I haven't got another one with Jessie.

Hmm - well there isn't a problem staying with node10 as it's still LTS... - or you could go to stretch first maybe ? (Though personally I haven't had any problems with Buster.)

I am trying to use node-red-contrib-onvif-nodes which appears to need 12.x, at least I think that is what the the problem is. As I said earlier I want to upgrade the Pi to buster, but that is a major exercise as this is a key part of my system so I the act of updating needs to be taken carefully. I can run the onvif node on a different pi though and link it in to my main dashboard so it is not an insurmountable problem. I may just have to put up with it.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.