Update-nodejs-and-nodered on Raspbian Buster

After clean install with raspbian 2019-06-20, I try to upgrade with

script, then it failed with 'Failed to install Node.js'.

After that, I found new script on /usr/bin/update-nodejs-and-nodered , already installed. Its based with package install.

# Copyright 2018 JS Foundation and other contributors, https://js.foundation/
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and
# limitations under the License.

sudo apt-get update
sudo apt-get -q -y install nodejs npm nodered
nv1=$(npm -v 2>/dev/null)
nv2=$(npm show npm version 2>/dev/null)
if [ "$nv1" != "$nv2" ]; then
    echo -e "Installing npm $nv2. Please wait, this can take a while"
    sudo npm i -g npm@latest 2>/dev/null
    hash -r
    nv3=$(npm -v 2>/dev/null)
    if [ "$nv3" = "1.4.21" ]; then
        echo -e "\nFailed to install latest version of npm - rewinding\n"
        sudo apt-get -y purge npm
        echo -e "\nnpm uninstalled"
        echo -e "\nnpm now version $nv3"
    echo -e "\nnpm now version $nv1"

on Buster, new policy exist with install Node-RED? Is it official?

Thanks in advice.

I installed new Buster and using the standard script

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

I got




Which buster image did you start with ?

Just to answer this point, the pre-packaged version of node-red has included this script for a while. This script will update node.js/node-red to whatever is the latest package in the apt repository, and it will install the npm package if it isn't present (which is isn't by default).

It helps a bit with the pre-packaged version, but we still strongly recommend users use the script our documentation points at instead. That gets you a much cleaner setup than the pre-packaged version is able to.

I agree, but 'update-nodejs-and-nodered' which node-red team sugested version is failed like @cymplecy 's screen shot today.

I used with "Raspbian Buster with desktop and recommended software".

Buster was released less than 24 hours ago. We had no advanced notice. If there is something in Buster that breaks our script, it will get it fixed.

That's right. I will temporarily install using a binary package, but I would like to install it again if the installation script is fixed.

It should now be fixed


Nice! Thank you for the quick update.

Ok with me now as well on Pi3B+ :slight_smile:


Today after clean install with raspbian 2019-06-20 the error continues for me.
I used:bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

I'm getting the same error trying to install on a clean install of Buster using the script:

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

Errors indicate no room on disk, but I have a 32gb SD card installed.

What does running the command df -h return?

Appears to be a false alarm. I rebooted and it seems to have worked. Hoping it's not a corrupt SD card!

(reply to @stulander before they deleted their post)
Adding your issue to multiple threads isn't helpful. This thread is about Buster NOT Stretch lite

In you other thread you stated

Using stretch 2019-04-08 I get this after a clean install and running apt-get update

This thread was about using the recommended way to install which is not running apt-get update

Yes you're right, sorry.

EDIT: this information is wrong, my problem was the clock not syncing.
I solved my problem with "sudo ntpd -gq"

I've got exactly the same error, I fixed by changing line 208 from:

sudo apt install -y curl 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null


sudo apt install -y npm curl 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null

really ? the next line install nodejs which should include npm (as it should be installing node10 at that point)

Actually, not really. I was too quick to post.
I mute my errors with the above solution but node-red still doesn't run, because wrong npm version.
It turns out that was my clock that wasn't syncing, after sync with "sudo ntpd -gq" the script now works, so please forget or delete my post, it's noise.

1 Like