How to start/stop node-red? (and a bit more)

What do these commands show?
which node
which npm
apt policy nodejs
apt policy npm

It is not a problem, ignore it.

Don't worry, we all get that.

Reply:

pi@TimePi:~/.node-red $ which node
/usr/bin/node
pi@TimePi:~/.node-red $ which npm
/usr/bin/npm
pi@TimePi:~/.node-red $ apt policy node.js
node-jstimezonedetect:
  Installed: (none)
  Candidate: 1.0.6-2
  Version table:
     1.0.6-2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-buffer:
  Installed: (none)
  Candidate: 3.0.0-1
  Version table:
     3.0.0-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-localizer:
  Installed: (none)
  Candidate: 0.0.3-1
  Version table:
     0.0.3-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-stable-stringify:
  Installed: (none)
  Candidate: 1.0.1-1
  Version table:
     1.0.1-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-schema-traverse:
  Installed: (none)
  Candidate: 0.3.1-1
  Version table:
     0.3.1-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jszip-utils:
  Installed: (none)
  Candidate: 0.0.2+dfsg-1
  Version table:
     0.0.2+dfsg-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsv:
  Installed: (none)
  Candidate: 4.0.0+ds1-1
  Version table:
     4.0.0+ds1-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsonstream:
  Installed: (none)
  Candidate: 1.3.2-1
  Version table:
     1.3.2-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-schema:
  Installed: (none)
  Candidate: 0.2.3-1+deb10u1
  Version table:
     0.2.3-1+deb10u1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-js-cookie:
  Installed: (none)
  Candidate: 2.2.0-2
  Version table:
     2.2.0-2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsdom:
  Installed: (none)
  Candidate: 0.8.10+dfsg1-1
  Version table:
     0.8.10+dfsg1-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsesc:
  Installed: (none)
  Candidate: 2.5.2-1
  Version table:
     2.5.2-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-stringify-safe:
  Installed: (none)
  Candidate: 5.0.1-1
  Version table:
     5.0.1-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json3:
  Installed: (none)
  Candidate: 3.3.2-1
  Version table:
     3.3.2-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json5:
  Installed: (none)
  Candidate: 0.5.1-1+deb10u1
  Version table:
     0.5.1-1+deb10u1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-parse-better-errors:
  Installed: (none)
  Candidate: 1.0.2-2
  Version table:
     1.0.2-2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-js-yaml:
  Installed: (none)
  Candidate: 3.11.0+dfsg-1
  Version table:
     3.11.0+dfsg-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jssip:
  Installed: (none)
  Candidate: 0.6.34-5
  Version table:
     0.6.34-5 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-loader:
  Installed: (none)
  Candidate: 0.5.4-1
  Version table:
     0.5.4-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsonminify:
  Installed: (none)
  Candidate: 0.4.1+dfsg1-1
  Version table:
     0.4.1+dfsg1-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsprim:
  Installed: (none)
  Candidate: 1.4.0-1
  Version table:
     1.4.0-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsonselect:
  Installed: (none)
  Candidate: 0.4.0+dfsg3-1
  Version table:
     0.4.0+dfsg3-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsonfile:
  Installed: (none)
  Candidate: 5.0.0-1
  Version table:
     5.0.0-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsonparse:
  Installed: (none)
  Candidate: 1.3.1-6
  Version table:
     1.3.1-6 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json2module:
  Installed: (none)
  Candidate: 0.0.3-1
  Version table:
     0.0.3-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jszip:
  Installed: (none)
  Candidate: 3.1.4+dfsg-1+deb10u1
  Version table:
     3.1.4+dfsg-1+deb10u1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsonify:
  Installed: (none)
  Candidate: 0.0.0-1
  Version table:
     0.0.0-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jschardet:
  Installed: (none)
  Candidate: 1.6.0+dfsg-3
  Version table:
     1.6.0+dfsg-3 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-js-tokens:
  Installed: (none)
  Candidate: 2.0.0-1
  Version table:
     2.0.0-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-js-beautify:
  Installed: (none)
  Candidate: 1.7.5+dfsg-3
  Version table:
     1.7.5+dfsg-3 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-json-parse-helpfulerror:
  Installed: (none)
  Candidate: 1.0.3-2
  Version table:
     1.0.3-2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsbn:
  Installed: (none)
  Candidate: 1.1.0-1
  Version table:
     1.1.0-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
node-jsonld:
  Installed: (none)
  Candidate: 1.5.3-1
  Version table:
     1.5.3-1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
pi@TimePi:~/.node-red $ apt policy npm
npm:
  Installed: (none)
  Candidate: 5.8.0+ds6-4+deb10u2
  Version table:
     5.8.0+ds6-4+deb10u2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
pi@TimePi:~/.node-red $ 

It is kind of the ...... main machine.

I guess I could update it, but.......

I'd have to remember all the stuff I've got installed on it and install them on the new build.
(Not the end of the world.)

I updated form ...... jessie to buster a few years ago.

(just mentioning)

Everything was working and I was editing code in a subflow.

DEPLOY..... (wait wait wait)..... no response from server.

The details are important when entering commands

Yup, been there, done that. I still have one Pi running Bullseye.
Probably best to concentrate on NR just now.

There was a time when you had to install npm seperately but I think that was back at Wheezy.

"Everything was working" Hmm something broke, let's hope it's not the SD card failing.

Stepping back while Colin diagnoses...

I hope the SD card isn't on it's way out.

Haven't had any other problems. I was just .... stupidly ..... trying to get a bit of code working.

Did you see my last post?

Yes, but I do not know what it means.

So wasn't sure if it was a question or statement.

I posted

You mistyped the third one.

Sorry.

Finger nails are long.

I slightly changed the order only that they are

which node
which npm
apt policy npm
apt policy nodejs

Only that their outputs are small to large.

pi@TimePi:~/.node-red $ which node
/usr/bin/node
pi@TimePi:~/.node-red $ which npm
/usr/bin/npm
pi@TimePi:~/.node-red $ apt policy npm
npm:
  Installed: (none)
  Candidate: 5.8.0+ds6-4+deb10u2
  Version table:
     5.8.0+ds6-4+deb10u2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
pi@TimePi:~/.node-red $ apt policy nodejs
nodejs:
  Installed: 20.19.0-1nodesource1
  Candidate: 20.19.0-1nodesource1
  Version table:
 *** 20.19.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
        100 /var/lib/dpkg/status
     20.18.3-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.18.2-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.18.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.18.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.17.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.16.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.15.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.15.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.14.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.13.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.13.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.12.2-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.12.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.12.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.11.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.11.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.10.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.9.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.8.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.8.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.7.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.6.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.6.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.5.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.5.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.4.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.3.1-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.3.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.2.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.1.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     20.0.0-1nodesource1 500
        500 https://deb.nodesource.com/node_20.x nodistro/main armhf Packages
     10.24.0~dfsg-1~deb10u3 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
pi@TimePi:~/.node-red $ 

It was only the one you mistyped originally that we needed.

That all looks ok, what about
node -v
npm -v

pi@TimePi:~/.node-red $ node -v
node: /lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
pi@TimePi:~/.node-red $ npm -v
node: /lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
pi@TimePi:~/.node-red $ 

Make sure all your os packages are up to date
sudo apt update && sudo apt full-upgrade

Then try the -v commands again.

pi@TimePi:~/.node-red $ sudo apt update && sudo apt full-upgrade
Hit:1 https://deb.nodesource.com/node_20.x nodistro InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease                                                     
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@TimePi:~/.node-red $ node -v
node: /lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
pi@TimePi:~/.node-red $ npm -v
node: /lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
pi@TimePi:~/.node-red $ 

I realise it isn't that, nodejs 18 is the latest supported for buster, so re-run the script but with --node18 instead of 20

It's down to the Install Node.js 18 LTS line....

Wow! Done. Moving to next line.

Installing core now.

DONE....

:slight_smile:

Try running it now?

Or copy the files back first?

Don't you keep image backups of all your SD cards? If not then you should. Then when one fails you just need to re-burn it on a new card.

1 Like

Try it, run
node-red-start

1 Like