# Installation failure on Rasp Pi running up to date Raspian Buster 10

**URL:** <https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828>\
**Category:** General\
**Created:** [26 October 2020 13:03 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828 "2020-10-26T13:03:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 13:03 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/1 "2020-10-26T13:03:51Z")

</div>

My rasp pi runs Raspian Buster 10.  
I have just updated everything sucessfully followed by a re-boot.  
When I run the below installation command

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

```

I get the below error in the terminal.

> 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 ✔  
> /dev/fd/63: line 296: lsb\_release: command not found  
> Install Node.js LTS ✘ Failed to install Node.js - Exit  
> Install Node-RED core  
> Move global nodes to local

Below are lines 296 to 312 from the install script.  
"lsb\_release" is right there on 296, but I don't understand much more than that.

> ```
> if [[$(lsb_release -d) == *"18.10"*]]; then 
> echo -ne " Apt install Node.js \r" 
> if sudo apt install -y nodejs npm curl 2>&1 | sudo tee -a /var/log/nodered -install.log >>/dev/null; then CHAR=$TICK; else CHAR=$CROSS; fi 
> echo -ne " Apt install Node.js $CHAR" 
> else 
> echo -ne " Install Node.js LTS \r" 
> # use the official script to install for other debian platforms 
> sudo apt install -y curl 2>&1 | sudo tee -a /var/log/nodered-install.log > >/dev/null 
> OV=`cat /etc/os-release | grep VERSION_ID | cut -d '"' -f 2` 
> if [["$OV" = "8"]]; then 
> curl -sSL https://deb.nodesource.com/setup_10.x | sudo -E bash - 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null 
> else 
> curl -sSL https://deb.nodesource.com/setup_12.x | sudo -E bash - 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null 
> fi 
> if sudo apt install -y nodejs 2>&1 | sudo tee -a /var/log/nodered-install. log >>/dev/null; then CHAR=$TICK; else CHAR=$CROSS; fi 
> echo -ne " Install Node.js LTS $CHAR" 
> fi
> 
> ```

Any ideas?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 October 2020 13:48 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/2 "2020-10-26T13:48:50Z")

</div>

What happens if you enter `lsb_release -d` on a terminal?

You should see `Description: Ubuntu 18.04.3 LTS` or similar

It seems not all Debian builds have `lsb_release` . For example, even the official Ubuntu Docker image does not have `lsb_release`. ([reference](https://serverfault.com/questions/476485/do-some-debian-builds-not-have-lsb-release))

perhaps you could apt-get install that?  
`sudo apt-get install lsb-core`

EDIT...  
@dceejay perhaps a bug in the installer script? I see in the `else` clause you do `cat /etc/os-release` but the OPs install seems to trip up here? (this area of computing is not is not my strongest suit so i may be way off - please tell me to do one if necessary 😜 )

---

<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:** [26 October 2020 14:03 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/3 "2020-10-26T14:03:27Z")

</div>

Too much "legacy" stuff in there I think - trying to keep old stuff going when we should really just abandon it. About time I bit the bullet and just moved it all up to node12.

but yes in terms of this issue installing lsb-core should fix it. (though it's in my version of buster ☹

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 14:09 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/4 "2020-10-26T14:09:42Z")

</div>

> [@Steve-Mcl](#):
>
> lsb\_release -d

Thanks for the reply. Here is the output

> pi@raspberrypi:~ $ lsb\_release -d  
> -bash: lsb\_release: command not found

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 14:17 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/5 "2020-10-26T14:17:00Z")

</div>

> [@kes](#):
>
> `lsb_release -d`

Installed it with

> sudo apt-get install -y lsb-release

Now I get

> pi@raspberrypi:~ $ lsb\_release -d  
> Description: Raspbian GNU/Linux 10 (buster)

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 14:29 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/6 "2020-10-26T14:29:15Z")

</div>

Here is the error I have now, after sucessfully installing lsb-release and re-booting.

> Stop Node-RED ✔  
> Remove old version of Node-RED ✔  
> Remove old version of Node.js ✔  
> Install Node.js LTS ✘ Failed to install Node.js - Exit  
> Clean npm cache  
> Install Node-RED core  
> Move global nodes to local  
> Install extra Pi nodes  
> Npm rebuild existing nodes  
> Add shortcut commands  
> Update systemd script

Log file at link. I wasn't allowed to post all the links the log contains  
[https://www.dropbox.com/s/c3fzbif6wlv11xh/nodered-install.log?dl=0](https://www.dropbox.com/s/c3fzbif6wlv11xh/nodered-install.log?dl=0)

---

<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:** [26 October 2020 14:37 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/7 "2020-10-26T14:37:47Z")

</div>

hmm . ok. looks like we got into a half in and half not in situation... to clean up do a  
`sudo apt remove -y nodejs nodejs-legacy npm`  
then lets get nodejs manually

```auto
curl -sSL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install -y nodejs
node -v && npm -v

```

should get you node 12 and npm 6.14  
then re-run the script ...

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 14:40 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/8 "2020-10-26T14:40:46Z")

</div>

Thanks. Here is the output

pi@raspberrypi:~ $ node -v && npm -v  
v10.21.0  
-bash: npm: command not found

Seems to have installed Node 10.21 and no npm.

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 14:42 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/9 "2020-10-26T14:42:25Z")

</div>

pi@raspberrypi:~ $ node -v  
v10.21.0

pi@raspberrypi:~ $ npm -v  
-bash: npm: command not found

---

<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:** [26 October 2020 14:42 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/10 "2020-10-26T14:42:57Z")

</div>

which Pi is this ? what does `uname -m` say ?  
after the sudo apt remove - what does `which node` report ?

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 14:48 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/11 "2020-10-26T14:48:07Z")

</div>

> [@dceejay](#):
>
> uname -m

I was looking down the same rabbit hole!  
It's an Arm 7!!

pi@raspberrypi:~ $ uname -m  
armv7l

---

<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:** [26 October 2020 14:57 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/12 "2020-10-26T14:57:50Z")

</div>

ok - so repeat the

```auto
sudo apt purge -y nodejs
node -v
which node

```

to check it's been removed...

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 15:02 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/13 "2020-10-26T15:02:10Z")

</div>

> [@dceejay](#):
>
> `node -v`

Thanks. I got it installed with these

wget [https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-armv7l.tar.xz](https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-armv7l.tar.xz)  
tar -xvf node-v12.19.0-linux-armv7l.tar.xz  
cd node-v12.19.0-linux-armv7l/  
sudo cp -R \* /usr/local/  
node -v

# v12.19.0

npm -v

# 6.14.8

Now I have Node 12.19 and NPM 6.14.

I will now re-run the script.

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 15:12 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/15 "2020-10-26T15:12:55Z")

</div>

Still errors

> Stop Node-RED ✔  
> Remove old version of Node-RED ✔  
> Remove old version of Node.js ✔  
> Install Node.js LTS ✘ Failed to install Node.js - Exit  
> Clean npm cache  
> Install Node-RED core  
> Move global nodes to local  
> Install extra Pi nodes  
> Npm rebuild existing nodes  
> Add shortcut commands  
> Update systemd script

Log here [Dropbox - File Deleted - Simplify your life](https://www.dropbox.com/s/hos4vy5mtnhn3ve/nodered-install_2.log?dl=0)

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [26 October 2020 15:21 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/16 "2020-10-26T15:21:31Z")

</div>

Got it going with

> sudo npm install -g --unsafe-perm node-red

Thanks for all your help

---

<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:** [26 October 2020 15:44 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/17 "2020-10-26T15:44:50Z")

</div>

that's still odd - the log says -  
Versions: node:v10.21.0 npm:  
where is it getting that from now that you removed it and added 12 ?

what does `which node` return please ?

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [3 November 2020 10:13 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/18 "2020-11-03T10:13:23Z")

</div>

Hi @dceejay

Thank you for your help, which kept me going through the node red install, which is always worth it for the end goal of having node red.

Much appreciated. It definatley helped me along the way..

The installation script, on the node red site, in my opinion surpasses the KISS principle, looking rather unweildly.

As someone who years ago faintly got to know LAMP stacks, I still really have no idea what node js, npm and nginx are. They always seem convoluted to me.  
When I have used npm for some installation or another, eg node red, it looks like it is breaking stuff during the install, even if it works after the install.

Maybe a simple LAMP stack with a tarball install was not possible for the node red platform, but it would much reduce the barrier to entry for new comers entering the otherwise superb node red world.

Node red itself is superb.

I do wander if uptake of node red would increase significantly by reducing install barriers, through using better known / apparently simpler technology.

Here is the simple script I used to get node red working on a ARM 7 pi:

```auto

sudo apt-get install -y lsb-release

# remove any npm or node js already installed

# if u know where these are installed simple deletion of directorys will get rid of it
# be careful. Save any config files or flows

sudo apt remove -y nodejs nodejs-legacy npm

# Check whether you have Rasp Pi Arm 7 or Arm 8 processor with this command
# u need this to get the right file at the below web address
uname -m

# head over to here and down load the relevant file
# https://nodejs.org/en/download/

# change to home dir
cd ~/

# download the relevant file, in this case Arm 7
wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-armv7l.tar.xz

# unpack it
tar -xvf node-v12.19.0-linux-armv7l.tar.xz

# change to newly created directory
cd node-v12.19.0-linux-armv7l/

# copy the files to /usr/local so they work
sudo cp -R * /usr/local/

# check the versions
node -v
# v12.19.0

npm -v
# 6.14.8

# change back to home dir
cd ~/

# install node red
# ps npm installs always look scary but often seem to work afterwards
sudo npm install -g --unsafe-perm node-red

# start node red with this command
node-red &

# surf to the node red interface on your laptop
http://your-pi-ip-here:1880

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [3 November 2020 10:47 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/19 "2020-11-03T10:47:54Z")

</div>

The problem is that your script would not be sufficient for many users. Just a couple of examples, it will not work on a Pi Zero, or Ubuntu and it does not cope with a system which already has an old version of nodejs installed.  
Also it does not setup service scripts for starting node-red on boot.  
There are lots of other situations it won't cope with if I thought about it a bit longer.

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [3 November 2020 10:49 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/20 "2020-11-03T10:49:47Z")

</div>

@Colin

Ok.

Thanks.

There's always a caveat, I understand that, and yes, I didn't think of ubuntu, zeros or other systems, or start service on boot.

No doubt maintaining the script is a challenge for the maintainer.

So much qdos to who ever does that. It is appreciated.

It occured to me that I only needed 13 SLOC for the ARM 7 pi install.

I do understand that the picture will be bigger than I see. I try to undertand that most of life works that way.

---

<div class="post-metadata">

**Author:** ![kes](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kes](https://discourse.nodered.org/u/kes)\
**Post date:** [3 November 2020 10:59 UTC](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828/21 "2020-11-03T10:59:22Z")

</div>

@Colin thanks. That got me thinking.  
It's also likley that so much investment, time etc, has gone into development on the npm technology platform etc that moving to something else not practically possible.  
U made a good point about adaptability of the install script.

[Next page](https://discourse.nodered.org/t/installation-failure-on-rasp-pi-running-up-to-date-raspian-buster-10/34828.md?page=2)
