Search code examples
node.jsraspberry-pinode-red

current, correct way to update nodejs and node-red on raspberry pi?


Attempting to update my three raspberry-pi NodeRed installations, I am getting these errors:

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)

Any methods I have used have failed to install/update Node.js.

At this point I am fine with completely removing node-red and nodejs and re-installing from scratch.

So:

How can I correctly update Node.js and node-red at this point? or How can I completely remove node.js and node-red and start over?

EDIT:

PI - 2 Model B (BCM2835, rev a21041). Running Jessie 4.9.35v7+ 2017-07-05.

Running script from https://nodered.org/docs/getting-started/raspberrypi results in this error:

/dev/fd/63: line 298: syntax error near unexpected token `fi'
/dev/fd/63: line 298: `        fi'

This happened early on, and I went down a lot of side roads from various google searches, trying different approaches. Did not leave myself enough breadcrumbs to re-create exactly how I got here, unfortunately. I used scripts from different github sites using NPM or bash<-curl(my-version-of-update-nodejs-and-nodered).


Solution

  • The right way to both install and upgrade Node-RED on a Raspberry Pi is to use the install script linked to from the Node-RED install docs here.

    This script will remove any current version of NodeJS and Node-RED and install the latest version that will work on the correct processor in the Pi (e.g. NodeJS don't formally ship a build that will run on a Raspberry Pi Zero anymore)