# Update-nodejs-and-nodered on Raspbian Buster

**URL:** <https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566>\
**Category:** Hardware\
**Created:** [25 June 2019 05:36 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566 "2019-06-25T05:36:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![utaani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/utaani/32/102_2.png) [@utaani](https://discourse.nodered.org/u/utaani)\
**Post date:** [25 June 2019 05:36 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/1 "2019-06-25T05:36:38Z")

</div>

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

> <https://github.com/node-red/raspbian-deb-package/blob/master/resources/update-nodejs-and-nodered>

  
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.

```auto
#!/bin/bash
#
# 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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"
    else
        echo -e "\nnpm now version $nv3"
    fi
else
    echo -e "\nnpm now version $nv1"
fi

```

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

Thanks in advice.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [25 June 2019 07:25 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/2 "2019-06-25T07:25:08Z")

</div>

I installed new Buster and using the standard script

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

```

I got

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/37aecd71ca59cf04a9d060e31d46fcd3d138ef9c.jpeg)

and

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0f765c83bf7a734dca416d556a328649b51d7a44.jpeg)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 June 2019 07:42 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/3 "2019-06-25T07:42:33Z")

</div>

Which buster image did you start with ?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [25 June 2019 08:23 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/4 "2019-06-25T08:23:15Z")

</div>

> [@utaani](#):
>
> After that, I found new script on /usr/bin/update-nodejs-and-nodered

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.

---

<div class="post-metadata">

**Author:** ![utaani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/utaani/32/102_2.png) [@utaani](https://discourse.nodered.org/u/utaani)\
**Post date:** [25 June 2019 08:31 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/6 "2019-06-25T08:31:42Z")

</div>

> [@knolleary](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![utaani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/utaani/32/102_2.png) [@utaani](https://discourse.nodered.org/u/utaani)\
**Post date:** [25 June 2019 08:32 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/7 "2019-06-25T08:32:19Z")

</div>

> [@dceejay](#):
>
> Which buster image did you start with ?

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

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [25 June 2019 08:34 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/8 "2019-06-25T08:34:25Z")

</div>

> [@utaani](#):
>
> I agree, but 'update-nodejs-and-nodered' which node-red team sugested version is failed like @cymplecy 's screen shot today.

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.

---

<div class="post-metadata">

**Author:** ![utaani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/utaani/32/102_2.png) [@utaani](https://discourse.nodered.org/u/utaani)\
**Post date:** [25 June 2019 08:39 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/9 "2019-06-25T08:39:30Z")

</div>

> [@knolleary](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 June 2019 08:59 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/10 "2019-06-25T08:59:27Z")

</div>

It should now be fixed

---

<div class="post-metadata">

**Author:** ![utaani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/utaani/32/102_2.png) [@utaani](https://discourse.nodered.org/u/utaani)\
**Post date:** [25 June 2019 09:56 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/11 "2019-06-25T09:56:50Z")

</div>

Nice! Thank you for the quick update.

 ![fixed](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cf1657f2cf9d768f21f3ffdfcaf4c9ba621c9162.png)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [25 June 2019 10:12 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/12 "2019-06-25T10:12:11Z")

</div>

Ok with me now as well on Pi3B+ 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/47c31b9322049da73122e918733930b479827b83.jpeg)

---

<div class="post-metadata">

**Author:** ![Andres\_M](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Andres\_M](https://discourse.nodered.org/u/Andres_M)\
**Post date:** [10 July 2019 02:03 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/13 "2019-07-10T02:03:41Z")

</div>

> [@utaani](#):
>
> After clean install with raspbian 2019-06-20

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)`

 ![Captura](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bf1afbbf4fceea915fcb397795cbbb3013b8c41e.png)

---

<div class="post-metadata">

**Author:** ![Exit2Studios](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/exit2studios/32/10998_2.png) [@Exit2Studios](https://discourse.nodered.org/u/Exit2Studios)\
**Post date:** [17 August 2019 17:13 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/14 "2019-08-17T17:13:55Z")

</div>

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)`

 ![57%20PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3d7ab8d7da7936bdecbb42116f65d6b24a2e1cbf.png)

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

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [17 August 2019 17:20 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/15 "2019-08-17T17:20:12Z")

</div>

What does running the command `df -h` return?

---

<div class="post-metadata">

**Author:** ![Exit2Studios](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/exit2studios/32/10998_2.png) [@Exit2Studios](https://discourse.nodered.org/u/Exit2Studios)\
**Post date:** [17 August 2019 17:58 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/16 "2019-08-17T17:58:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 August 2019 14:58 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/18 "2019-08-28T14:58:12Z")

</div>

(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

---

<div class="post-metadata">

**Author:** ![stulander](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@stulander](https://discourse.nodered.org/u/stulander)\
**Post date:** [28 August 2019 15:07 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/19 "2019-08-28T15:07:35Z")

</div>

Yes you're right, sorry.

---

<div class="post-metadata">

**Author:** ![rpalma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rpalma/32/9740_2.png) [@rpalma](https://discourse.nodered.org/u/rpalma)\
**Post date:** [4 September 2019 13:49 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/20 "2019-09-04T13:49:26Z")

</div>

> [@utaani](#):
>
> /usr/bin/update-nodejs-and-nodered , already installed. Its based with package install.

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

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

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

```

to:

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

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 September 2019 14:08 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/21 "2019-09-04T14:08:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rpalma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rpalma/32/9740_2.png) [@rpalma](https://discourse.nodered.org/u/rpalma)\
**Post date:** [4 September 2019 14:24 UTC](https://discourse.nodered.org/t/update-nodejs-and-nodered-on-raspbian-buster/12566/22 "2019-09-04T14:24:31Z")

</div>

> [@dceejay](#):
>
> lly ? the next line install nodejs

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.
