NodeRED couldn´t install - Nodejs Bad install: Node.js missing

Hello, I have a fresh Raspberry Pi 32bit OS Bullseye with desktop. I have a failure while install process:

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       ✔
dpkg-query: package 'nodejs' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
  Install Node    ✘   Bad install:  Node.js missing  Npm missing - Exit
  Move global nodes to local
  Npm rebuild existing nodes
  Install extra Pi nodes
  Add shortcut commands
  Update systemd script

Input from: nodesource.list

deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main

Can someone help me please?

What version PI are you using?
Did you use the script from here: Running on Raspberry Pi : Node-RED

open a terminal window and run the command. Then copy everything from when you run the command till it ends and paste it in a reply

Hi, here the result:

pi@PV:~ $ bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)


This script checks the version of node.js installed is 16 or greater. It will try to
install node 18 if none is found. It can optionally install node 16, 18 or 20 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

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                       ✔
  Remove old version of Node-RED      ✔
  Remove old version of Node.js       ✔
dpkg-query: package 'nodejs' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
  Install Node    ✘   Bad install:  Node.js missing  Npm missing - Exit
  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@PV:~ $ sudo nano /var/log/nodered-install.log

OLD nodejs 0 :
NEW nodejs  :

***************************************

Started : Mon 4 Mar 10:41:01 CET 2024
Running for user pi at /home/pi
Failed to stop nodered.service: Unit nodered.service not loaded.
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
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 chromium-browser : Depends: chromium-codecs-ffmpeg-extra (= 119.0.6045.171-rpt1) but 122.0.6261.89-rpt1 is to be installed or
                             chromium-codecs-ffmpeg (= 119.0.6045.171-rpt1) but it is not going to be installed
 chromium-browser-l10n : Depends: chromium-browser (>= 122.0.6261.89-rpt1) but 119.0.6045.171-rpt1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Installing nodejs 18

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

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.

Try running

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

Same behavior:

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

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:
dpkg-query: package 'nodejs' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
Install Node ✘ Bad install: Node.js missing Npm missing - Exit
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

Log file:

OLD nodejs 0 :
NEW nodejs  :

***************************************

Started : Mon 4 Mar 10:41:01 CET 2024
Running for user pi at /home/pi
Failed to stop nodered.service: Unit nodered.service not loaded.
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
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 chromium-browser : Depends: chromium-codecs-ffmpeg-extra (= 119.0.6045.171-rpt1) but 122.0.6261.89-rpt1 is to be installed or
                             chromium-codecs-ffmpeg (= 119.0.6045.171-rpt1) but it is not going to be installed
 chromium-browser-l10n : Depends: chromium-browser (>= 122.0.6261.89-rpt1) but 119.0.6045.171-rpt1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Installing nodejs 18

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

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.

If I run sudo apt upgrade there is a failure with chromium update. I can´t solve this. Maybe this is a problem and the reason for node red installation fail?
This is a fresh Bullseye install on a Raspberry Pi 3

Does sudo apt install npm work?
If so, does the Node-red install script (including --node18) then work?

It isn't a problem with installing nodejs or node red, it is a problem with your system. Run
sudo apt update && sudo apt full-upgrade
I think that will show errors. Once you have sorted those, run the install script again.

@jbudd Thanks, I think it makes sense to try it after the idea from @Colin and also me: Chromium update makes problems after fresh install Bullseye 32bit with desktop on Pi 3.

I made again a fresh install on a SD card. First steps with this OS are following:

pi@PV:~ $ sudo apt update && sudo apt full-upgrade
Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
39 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libfuse2
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
  base-files bind9-host bind9-libs bluez chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra cifs-utils curl
  distro-info-data gstreamer1.0-plugins-bad libbluetooth3 libcurl3-gnutls libcurl4 libde265-0 libglib2.0-0 libglib2.0-bin
  libglib2.0-data libgnutls30 libgstreamer-plugins-bad1.0-0 libnftables1 libperl5.32 libssh-gcrypt-4 libzbar0 libzmq5 nftables
  openssh-client openssh-server openssh-sftp-server perl perl-base perl-modules-5.32 ssh tar tzdata usb.ids xserver-common
  xserver-xorg-core xwayland
39 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 154 MB of archives.
After this operation, 10.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian bullseye/main armhf bluez armhf 5.55-3.1+rpt2+deb11u1 [844 kB]
Get:4 http://archive.raspberrypi.org/debian bullseye/main armhf chromium-browser-l10n all 122.0.6261.89-rpt1 [6,613 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf base-files armhf 11.1+rpi1+deb11u9 [70.5 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libperl5.32 armhf 5.32.1-4+deb11u3 [3,387 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf perl armhf 5.32.1-4+deb11u3 [293 kB]
Get:7 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf perl-modules-5.32 all 5.32.1-4+deb11u3 [2,823 kB]
Get:8 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf tar armhf 1.34+dfsg-1+deb11u1 [800 kB]
Get:10 http://archive.raspberrypi.org/debian bullseye/main armhf chromium-browser armhf 122.0.6261.89-rpt1 [113 MB]
Get:12 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libglib2.0-data all 2.66.8-1+deb11u1 [1,177 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf perl-base armhf 5.32.1-4+deb11u3 [1,434 kB]
Get:14 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libglib2.0-0 armhf 2.66.8-1+deb11u1 [1,186 kB]
Get:9 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf nftables armhf 0.9.8-3.1+deb11u2 [68.2 kB]
Get:11 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libnftables1 armhf 0.9.8-3.1+deb11u2 [227 kB]
Get:13 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libglib2.0-bin armhf 2.66.8-1+deb11u1 [135 kB]
Get:15 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf openssh-sftp-server armhf 1:8.4p1-5+deb11u3 [42.8 kB]
Get:16 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf openssh-server armhf 1:8.4p1-5+deb11u3 [319 kB]
Get:18 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf ssh all 1:8.4p1-5+deb11u3 [252 kB]
Get:17 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf openssh-client armhf 1:8.4p1-5+deb11u3 [796 kB]
Get:19 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libgnutls30 armhf 3.7.1-5+deb11u4 [1,263 kB]
Get:20 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf tzdata all 2024a-0+deb11u1 [304 kB]
Get:21 http://ftp.gwdg.de/pub/linux/debian/raspbian/raspbian bullseye/main armhf bind9-libs armhf 1:9.16.48-1 [1,278 kB]
Get:22 http://ftp.gwdg.de/pub/linux/debian/raspbian/raspbian bullseye/main armhf bind9-host armhf 1:9.16.48-1 [310 kB]
Get:23 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf cifs-utils armhf 2:6.11-3.1+deb11u2 [85.2 kB]
Get:24 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf curl armhf 7.74.0-1.3+deb11u11 [259 kB]
Get:25 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libcurl4 armhf 7.74.0-1.3+deb11u11 [310 kB]
Get:26 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf distro-info-data all 0.51+deb11u5 [8,244 B]
Get:27 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libcurl3-gnutls armhf 7.74.0-1.3+deb11u11 [306 kB]
Get:28 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libde265-0 armhf 1.0.11-0+deb11u3+rpi1 [134 kB]
Get:29 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gstreamer1.0-plugins-bad armhf 1.18.4-3+deb11u4 [3,863 kB]
Get:30 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libgstreamer-plugins-bad1.0-0 armhf 1.18.4-3+deb11u4 [2,258 kB]
Get:31 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libzbar0 armhf 0.23.90-1+deb11u1 [117 kB]
Get:32 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libssh-gcrypt-4 armhf 0.9.8-0+deb11u1 [190 kB]
Get:33 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libzmq5 armhf 4.3.4-1+deb11u1 [231 kB]
Get:34 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf usb.ids all 2024.01.20-0+deb11u1 [208 kB]
Get:35 http://archive.raspberrypi.org/debian bullseye/main armhf chromium-codecs-ffmpeg-extra armhf 122.0.6261.89-rpt1 [1,027 kB]
Get:36 http://archive.raspberrypi.org/debian bullseye/main armhf libbluetooth3 armhf 5.55-3.1+rpt2+deb11u1 [106 kB]
Get:37 http://archive.raspberrypi.org/debian bullseye/main armhf xserver-common all 2:1.20.11-1+rpt3+deb11u11 [2,285 kB]
Get:38 http://archive.raspberrypi.org/debian bullseye/main armhf xserver-xorg-core armhf 2:1.20.11-1+rpt3+deb11u11 [3,352 kB]
Get:39 http://archive.raspberrypi.org/debian bullseye/main armhf xwayland armhf 2:1.20.11-1+rpt3+deb11u11 [2,970 kB]
Fetched 154 MB in 52s (2,986 kB/s)
Reading changelogs... Done
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 106663 files and directories currently installed.)
Preparing to unpack .../base-files_11.1+rpi1+deb11u9_armhf.deb ...
Unpacking base-files (11.1+rpi1+deb11u9) over (11.1+rpi1+deb11u8) ...
Setting up base-files (11.1+rpi1+deb11u9) ...
Installing new version of config file /etc/debian_version ...
(Reading database ... 106663 files and directories currently installed.)
Preparing to unpack .../libperl5.32_5.32.1-4+deb11u3_armhf.deb ...
Unpacking libperl5.32:armhf (5.32.1-4+deb11u3) over (5.32.1-4+deb11u2) ...
Preparing to unpack .../perl_5.32.1-4+deb11u3_armhf.deb ...
Unpacking perl (5.32.1-4+deb11u3) over (5.32.1-4+deb11u2) ...
Preparing to unpack .../perl-base_5.32.1-4+deb11u3_armhf.deb ...
Unpacking perl-base (5.32.1-4+deb11u3) over (5.32.1-4+deb11u2) ...
Setting up perl-base (5.32.1-4+deb11u3) ...
(Reading database ... 106663 files and directories currently installed.)
Preparing to unpack .../perl-modules-5.32_5.32.1-4+deb11u3_all.deb ...
Unpacking perl-modules-5.32 (5.32.1-4+deb11u3) over (5.32.1-4+deb11u2) ...
Preparing to unpack .../tar_1.34+dfsg-1+deb11u1_armhf.deb ...
Unpacking tar (1.34+dfsg-1+deb11u1) over (1.34+dfsg-1) ...
Setting up tar (1.34+dfsg-1+deb11u1) ...
(Reading database ... 106663 files and directories currently installed.)
Preparing to unpack .../00-nftables_0.9.8-3.1+deb11u2_armhf.deb ...
Unpacking nftables (0.9.8-3.1+deb11u2) over (0.9.8-3.1+deb11u1) ...
Preparing to unpack .../01-libnftables1_0.9.8-3.1+deb11u2_armhf.deb ...
Unpacking libnftables1:armhf (0.9.8-3.1+deb11u2) over (0.9.8-3.1+deb11u1) ...
Preparing to unpack .../02-libglib2.0-data_2.66.8-1+deb11u1_all.deb ...
Unpacking libglib2.0-data (2.66.8-1+deb11u1) over (2.66.8-1) ...
Preparing to unpack .../03-libglib2.0-bin_2.66.8-1+deb11u1_armhf.deb ...
Unpacking libglib2.0-bin (2.66.8-1+deb11u1) over (2.66.8-1) ...
Preparing to unpack .../04-libglib2.0-0_2.66.8-1+deb11u1_armhf.deb ...
Unpacking libglib2.0-0:armhf (2.66.8-1+deb11u1) over (2.66.8-1) ...
Preparing to unpack .../05-bluez_5.55-3.1+rpt2+deb11u1_armhf.deb ...
Unpacking bluez (5.55-3.1+rpt2+deb11u1) over (5.55-3.1+rpt2) ...
Preparing to unpack .../06-chromium-browser-l10n_122.0.6261.89-rpt1_all.deb ...
Unpacking chromium-browser-l10n (122.0.6261.89-rpt1) over (119.0.6045.171-rpt1) ...
Preparing to unpack .../07-chromium-browser_122.0.6261.89-rpt1_armhf.deb ...
Unpacking chromium-browser (122.0.6261.89-rpt1) over (119.0.6045.171-rpt1) ...
dpkg-deb (subprocess): decompressing archive '/tmp/apt-dpkg-install-1bSleP/07-chromium-browser_122.0.6261.89-rpt1_armhf.deb' (size=112664436) member 'data.tar': lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /tmp/apt-dpkg-install-1bSleP/07-chromium-browser_122.0.6261.89-rpt1_armhf.deb (--unpack):
 cannot copy extracted data for './usr/lib/chromium-browser/chromium-browser' to '/usr/lib/chromium-browser/chromium-browser.dpkg-new': unexpected end of file or stream
Preparing to unpack .../08-chromium-codecs-ffmpeg-extra_122.0.6261.89-rpt1_armhf.deb ...
Unpacking chromium-codecs-ffmpeg-extra (122.0.6261.89-rpt1) over (119.0.6045.171-rpt1) ...
Preparing to unpack .../09-openssh-sftp-server_1%3a8.4p1-5+deb11u3_armhf.deb ...
Unpacking openssh-sftp-server (1:8.4p1-5+deb11u3) over (1:8.4p1-5+deb11u2) ...
Preparing to unpack .../10-openssh-server_1%3a8.4p1-5+deb11u3_armhf.deb ...
Unpacking openssh-server (1:8.4p1-5+deb11u3) over (1:8.4p1-5+deb11u2) ...
Preparing to unpack .../11-openssh-client_1%3a8.4p1-5+deb11u3_armhf.deb ...
Unpacking openssh-client (1:8.4p1-5+deb11u3) over (1:8.4p1-5+deb11u2) ...
Preparing to unpack .../12-ssh_1%3a8.4p1-5+deb11u3_all.deb ...
Unpacking ssh (1:8.4p1-5+deb11u3) over (1:8.4p1-5+deb11u2) ...
Preparing to unpack .../13-libgnutls30_3.7.1-5+deb11u4_armhf.deb ...
Unpacking libgnutls30:armhf (3.7.1-5+deb11u4) over (3.7.1-5+deb11u3) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-1bSleP/07-chromium-browser_122.0.6261.89-rpt1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
pi@PV:~ $

Is it possible to have a look and idea in this thread for the update issue first?

Did you manually install chromium browser? On my buster bullseye it is not installed.
I suggest uninstalling it.
sudo apt remove chromium-browser
Then try the update and upgrade again.

I have a fresh installation from the Raspberry Pi Imager v1.8.5
32bit Bullseye with desktop

Steps:
SD card in Pi 3
Power on
sudo apt update && sudo apt full-upgrade

Problem with Chromium update process

sudo apt remove chromium-browser
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 chromium-browser-l10n : Depends: chromium-browser (>= 122.0.6261.89-rpt1) but it is not going to be installed
                         Depends: chromium-browser (< 122.0.6261.89-rpt1.1~) but it is not going to be installed
 rpi-chromium-mods : Depends: chromium-browser (>= 92) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
pi@PV:~ $ sudo apt purge chromium-browser
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 chromium-browser-l10n : Depends: chromium-browser (>= 122.0.6261.89-rpt1) but it is not going to be installed
                         Depends: chromium-browser (< 122.0.6261.89-rpt1.1~) but it is not going to be installed
 rpi-chromium-mods : Depends: chromium-browser (>= 92) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Should I reinstall it new with first step: sudo apt remove chromium-browser?
Does it make sense or do you have other ideas?

No idea what influences their choice but the Pi imager recommends "Legacy" ie Buster 32 bit for the Pi 3b.

ok, I try the Bullseye 32bit image from here: https://www.raspberrypi.com/software/operating-systems/

Just uninstall chromium browser.

No idea what influences their choice but the Pi imager recommends "Legacy" ie Buster 32 bit for the Pi 3b.

Wayland still needs optimising for the older boards IIRC so rather than having some odd mix of compositor / DE selection they just limit it to the older OS (Bullseye).

You can run Bookworm on the older boards but have to not select your board in the imager.

Yes, Legacy is "A port of Debian Bullseye". My mistake.
Damn all these pesky bees.

Both the Pi 3 and Pi Zero Two have 64 bit processors but the OS they push for these devices is "Legacy" 32 bit.

I run Bookworm 64 bit on my Pi Zero Twos, but command line only so Wayland status makes no difference.
I am prepared to believe that Bullseye 32 bit CLI might give better performance than Bookworm 64 bit but I have never seen a statement of that from the Pi Organisation.

Thank you all for your information. I tried the Bookworm 32bit (because I need 32bit for some programs). But here is the problem with Bookworm AND 32bit it is not possible to use the VNC. It was for some days not possible to connect to this OS. This is the issue why I go with Bullseye 32bit.

Only problems. Now I try the different source from the 32bit Bullseye OS. Update is running.

RealVNC does not support Wayland on Bookworm - you can change to X11 in raspi-config or use TigerVNC

More details on Wayland can be found at https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/

So I found the solution for all topics.
The image Bullseye 32bit not from Raspberry Pi Imager works with the updates. Also direct the image.xz works.
While the long update process I found also the solution for the Real VNC on Bookworm 32bit.

I downloaded the real VNC Version 7.10.0 and installed it. In the raspi config I changed the Wayland to X11. Now I can use the newest Bookworm with 32bit with Real VNC. Wunderful! Thanks to all and I hope to help also others with my laset message here.

1 Like

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