Troubleshooting
Why the Node-RED install script fails at an apt repository error
Short answer
An apt refresh runs before the installer touches Node.js, and one failing source makes it exit non-zero, so the run stops before its own runtime and npm are ever installed. The blank npm in the final Versions line is a step that never happened, not a broken npm. Update and upgrade the system, repair any source that still errors, then rerun the script and confirm both version fields print.

On this page
The failure is not npm. The installer refreshes the package index with apt before it installs its own Node.js runtime, and in this log a third-party source answered that refresh with a certificate error and no Release file. apt exits non-zero when a single source fails, the script prints Error executing command, exiting, and the runtime it came to install is never put in place. The final Versions: node:v8.11.1 npm: line reports only what the machine had left: an old distribution Node and no npm. The fix is at the package-manager level: update and upgrade the system, repair or remove any source that still errors, rerun the script, and require both version fields to print.
Read the log in execution order, not by its last line #
The last line is a symptom. The cause is the first operation that failed, and the log names it earlier. Work through the messages in the order they appear:
| Message in the log | What it tells you | What to do |
|---|---|---|
WARNING: apt does not have a stable CLI interface. Use with caution in scripts. |
apt's standard notice to scripts; it appears on healthy runs too | Keep reading; this is not the failure |
An Err: line naming a source, with server certificate verification failed |
The TLS check against that repository failed | Check the clock, then the trust chain, then the source entry |
E: The repository ... does no longer have a Release file |
apt could not fetch usable metadata for that source | The same source as the Err: line; repair it or remove it |
Error executing command, exiting |
The script's own exit line: a command returned non-zero and the run stopped | Treat everything the run promised afterward as not done |
Versions: node:... npm: with the npm field empty |
The probe found a Node binary and no npm | Fix the refresh; do not chase npm |
One detail decides where you spend your time: the repository named in the error is not one the installer needs. The refresh walks every configured source, so an unrelated remote-support repository can stop a Node-RED install cold. That is why the repair is done in apt, not inside Node-RED.
Why the failed refresh leaves npm blank #
The script refreshes the index, then configures a Node.js package source, installs Node.js and npm, installs Node-RED, and reports versions. The first command that returns non-zero ends the run. When the refresh dies on a third-party source, the run finishes without the runtime it came to install, and the closing line can only report what the machine already had.
On this Debian 9 armhf image the distribution's nodejs package provides the node binary and no npm — hence a printed node version and an empty npm field. Two things follow. First, npm is not broken; it was never installed by this run. Second, the reported runtime is outside Node-RED's support set: the project supports the Maintenance and Active LTS lines of Node.js and currently recommends 24.x, and a Node 8 binary is in neither line. Even a hand-installed npm would leave an unsupported runtime, so the installer must be allowed to replace the runtime — which the failed refresh prevented.
Repair the sources, upgrade, then rerun #
- Back up what runs the plant. Copy the folder Node-RED runs from, under the account that owns it — flows, credentials and settings — and note how the service is started. The steps below change operating-system packages, and the upgrade touches the whole image.
- Check the clock before anything else. Compare the device's date with a trusted clock; a date wrong by months or years fails every certificate check. The install log's own start line shows the time the device believed when it ran.
- Run
sudo apt updateon its own and read everyErr:line. Each names one failing source. In the case worked below, a single third-party source failed while the rest refreshed. - Run
sudo apt upgrade, then repeat the refresh and read it again. The upgrade also refreshes the certificate and CA packages, and in the worked case it cleared the error entirely. - If a source still fails, decide whether you need its software. If it is needed, get the current repository entry from that software's supplier and replace the stale line in
/etc/apt/sources.listor the file that defines the source. If it is not needed, disable the entry through your normal change control. - Rerun the official install script and read the new log end to end.
Do not force the refresh through by marking the source trusted or switching off certificate verification: that tells apt to accept unauthenticated packages on a machine that executes your flows. Repair the entry or remove it.
Working the Debian 9 armhf log: one failed source against zero tolerated #
The inputs #
- Failed sources reported by the refresh: 1 — one
Err:line, numbered 5 in the output (from the install log). - Failed sources the script tolerates: 0 — its exit line fires on the first non-zero command (from the same log).
- Device time at start: Sat 12 Dec 2020 — plausible, so the clock check passes (from the log's start line).
- Runtime found afterward: node v8.11.1 and no npm — the distribution's build for this image (from the final Versions line).
- Support set: the Maintenance and Active LTS lines of Node.js, currently recommending 24.x (from the project's version documentation).
- Packages pending at upgrade: 333 (from the same install log).
The rule #
apt exits non-zero when one or more configured sources fail, even if every other source refreshes cleanly. The installer stops at the first non-zero command, so its supported runtime and npm arrive only after a clean refresh.
The arithmetic #
- Failed sources over tolerance: 1 − 0 = 1, so the refresh exits non-zero and the run stops inside its package setup.
- Supported runtimes and npm installed by the script in this state: 0 — the only Node left on the machine is the distribution's build, which ships without npm.
- Support gap of that leftover runtime: recommended major 24 − installed major 8 = 16 major versions, and major 8 sits below the Maintenance LTS line, so a patched-in npm would not make it supported.
- System change applied before the retry: 333 packages upgraded, after which the same repository refreshed without the certificate error.
The result #
With the refresh clean, the rerun installed the supported runtime and both version fields printed. That is the whole fix: no npm surgery, no manual Node install.
The decision #
Rerun the script only when sudo apt update finishes without an Err: line — the tolerance is zero failed sources, and one is enough to reproduce the blank npm. Accept the closing line only when the node major is a Maintenance or Active LTS release and the npm field is filled; anything else means a step was skipped again.
The acceptance check before you trust the install #
- A standalone
sudo apt updateruns to the end without an error line. - Both fields of the final Versions line are filled, and the node major is inside the supported LTS window.
- The Node-RED service starts and the editor loads the existing flows.
- Before rerunning on any other box, confirm which Linux release and processor architecture it runs, the checks covered in identify the Linux base before installing Node-RED natively, because the package sources involved depend on both.
- If a later run fails while npm talks to the registry with a getaddrinfo EAI_AGAIN error, that is name resolution, a different fault — see Node-RED getaddrinfo EAI_AGAIN means DNS, not internet.
Questions asked
How do I see which Node.js version apt would pick before rerunning the script?
Ask apt before rerunning: the policy listing for the nodejs package shows the installed version and the candidate version, with the source each comes from. Before the installer adds its own package source, the candidate can only be the distribution's build, which is how an old runtime ends up on the machine. After a successful run the candidate should come from the installer's source instead.
apt prints 'server certificate verification failed' — what do I check first?
The clock, then trust. A device date that is wrong by months or years fails every TLS check, so compare it with a trusted clock before anything else. If the time is right, a full system upgrade refreshes the CA certificate package. Networks that inspect TLS also require the inspection root certificate on the device, which your network administrator provides. Leave verification switched on.
Can I mark the failing repository as trusted so the installer gets past it?
No. A trusted flag or disabled verification tells apt to accept that source's packages without authenticating them, on a machine that runs your flows. The error means the source's metadata could not be validated. Get the current entry from the software's supplier, or disable the entry if the software is no longer needed, and refresh again.
Why not install Node-RED from the distribution's own package instead of the script?
Because distribution packages lag behind the project. The Node-RED package in Raspberry Pi OS has drawn in Node.js 12, a release the project no longer supports. The install script exists to place a runtime inside the supported LTS window on the machine, so repairing the package sources and rerunning the script is the supported route.
The install now completes, but the editor freezes after I edit a node. Same fault?
No. Once both versions print and the service runs, package installation is finished. Freezes after editing a node, or a duplicated node when one is dragged, point at the browser session; the default browser on small industrial controllers is limited. Open the editor in a current desktop browser on another computer — 192.168.1.100 on port 1880 as an example, with your device's own address — and repeat the same edit.
