# Installing on Ubuntu with script

**URL:** <https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515>\
**Category:** General\
**Created:** [13 September 2019 15:10 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515 "2019-09-13T15:10:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 15:10 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/1 "2019-09-13T15:10:32Z")

</div>

Hello,

I am attempting to install node-red on an ubuntu machine using the provided script, [https://nodered.org/docs/getting-started/raspberrypi](https://nodered.org/docs/getting-started/raspberrypi)

However it is exiting at 'Install Node.js LTS' with the error 'Failed to install Node.js'

If I do node -v it shows v8.10.0 installed.

How do I get past this?

Thanks  
James

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 September 2019 15:18 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/2 "2019-09-13T15:18:59Z")

</div>

Did you see this in the linked doc?

> This script will work on any Debian-based operating system, including Ubuntu and Diet-Pi. You may need to run `sudo apt-get install build-essential` first to ensure npm is able to build any binary modules it needs to install.

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 15:22 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/3 "2019-09-13T15:22:14Z")

</div>

Thanks

Yes, I have run that.

I've just tried again and it says nothing new to install. Main script still fails as before....

---

<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:** [13 September 2019 15:22 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/4 "2019-09-13T15:22:49Z")

</div>

what does the end of the install log say ?  
(last chunk)

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 15:26 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/5 "2019-09-13T15:26:24Z")

</div>

Selecting previously unselected package libhttp-parser2.7.1:amd64.  
Preparing to unpack .../libhttp-parser2.7.1\_2.7.1-2\_amd64.deb ...  
Unpacking libhttp-parser2.7.1:amd64 (2.7.1-2) ...  
Selecting previously unselected package nodejs.  
Preparing to unpack .../nodejs\_8.10.0~dfsg-2ubuntu0.4\_amd64.deb ...  
Unpacking nodejs (8.10.0~dfsg-2ubuntu0.4) ...  
Setting up nodejs-doc (8.10.0~dfsg-2ubuntu0.4) ...  
Setting up libhttp-parser2.7.1:amd64 (2.7.1-2) ...  
Setting up libuv1:amd64 (1.18.0-3) ...  
Setting up libc-ares2:amd64 (1.14.0-1) ...  
Setting up nodejs (8.10.0~dfsg-2ubuntu0.4) ...  
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto $  
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...  
Processing triggers for libc-bin (2.27-3ubuntu1) ...  
sudo: 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:** [13 September 2019 15:30 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/6 "2019-09-13T15:30:01Z")

</div>

hmm - it's picking up the debian node8 for some reason...  
so  
`sudo apt-get purge nodejs npm`  
then install nodejs manually

```auto
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

```

then re-run the script...  
(meanwhile I'll dig into why the script is taking this wrong path too many time s recently...)

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 15:33 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/7 "2019-09-13T15:33:22Z")

</div>

I've run those as you suggest but still get the same error when re-running the script...

---

<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:** [13 September 2019 15:38 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/8 "2019-09-13T15:38:10Z")

</div>

hmm  
what does  
`which node`  
return ?

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 15:39 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/9 "2019-09-13T15:39:12Z")

</div>

/usr/bin/node

---

<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:** [13 September 2019 15:45 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/10 "2019-09-13T15:45:35Z")

</div>

ok - so re-run - `sudo apt-get purge nodejs`  
then `which node` to check it's been removed.  
then - `sudo rm /etc/apt/sources.list.d/nodesource.list`  
to clear out the old nodesource repo (if it was there) then re-run

```auto
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

```

then `which node` and `node -v` to see what we have... at that point

---

<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:** [13 September 2019 15:46 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/11 "2019-09-13T15:46:20Z")

</div>

Ah... what box / processor are you running on ????

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 15:46 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/12 "2019-09-13T15:46:43Z")

</div>

how can I check that?

---

<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:** [13 September 2019 15:50 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/14 "2019-09-13T15:50:10Z")

</div>

sorry - try `uname -a`

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 15:50 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/15 "2019-09-13T15:50:51Z")

</div>

Linux DC-5 5.0.0-25-generic #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019 x86\_64 x86\_64 x86\_64 GNU/Linux

---

<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:** [13 September 2019 15:51 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/16 "2019-09-13T15:51:43Z")

</div>

ok - so yes - back to my previous thought - do that list...  
(It is 64bit - node10 isn't supported on 32bit)

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 16:00 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/17 "2019-09-13T16:00:21Z")

</div>

So running your list gives this:

dc@DC-5:~ which node /usr/bin/node dc@DC-5:~ node -v  
v8.10.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:** [13 September 2019 16:17 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/18 "2019-09-13T16:17:21Z")

</div>

errr - which it really can't...  
can you copy the output of the  
`curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -`  
command

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 16:18 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/19 "2019-09-13T16:18:20Z")

</div>

dc@DC-5:~$ curl -sL [https://deb.nodesource.com/setup\_10.x](https://deb.nodesource.com/setup_10.x) | sudo -E bash -

## Installing the NodeSource Node.js 10.x repo...

## Populating apt-get cache...

- apt-get update  
Get:1 [http://security.ubuntu.com/ubuntu](http://security.ubuntu.com/ubuntu) bionic-security InRelease [88.7 kB]  
Ign:2 [http://repo.mongodb.org/apt/ubuntu](http://repo.mongodb.org/apt/ubuntu) xenial/mongodb-org/3.4 InRelease  
Hit:3 [http://gb.archive.ubuntu.com/ubuntu](http://gb.archive.ubuntu.com/ubuntu) bionic InRelease  
Hit:4 [http://repo.mongodb.org/apt/ubuntu](http://repo.mongodb.org/apt/ubuntu) xenial/mongodb-org/3.4 Release  
Hit:5 [http://gb.archive.ubuntu.com/ubuntu](http://gb.archive.ubuntu.com/ubuntu) bionic-updates InRelease  
Hit:6 [http://gb.archive.ubuntu.com/ubuntu](http://gb.archive.ubuntu.com/ubuntu) bionic-backports InRelease  
Get:7 [https://dl.ubnt.com/unifi/debian](https://dl.ubnt.com/unifi/debian) unifi-5.10 InRelease [3,027 B]  
Reading package lists... Done  
E: Repository '[https://dl.ubnt.com/unifi/debian](https://dl.ubnt.com/unifi/debian) unifi-5.10 InRelease' changed its 'Suite' value from 'stable' to 'oldstable'  
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.  
Error executing command, exiting

---

<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:** [13 September 2019 16:21 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/20 "2019-09-13T16:21:28Z")

</div>

ahhhh - there we go...

try a `sudo apt update && sudo apt upgrade` manually first and accept the change  
then redo the nodejs install  
(have to go out for an hour or so - back in a bit) (but we are in google the answer territory now..)

---

<div class="post-metadata">

**Author:** ![ceejm1](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@ceejm1](https://discourse.nodered.org/u/ceejm1)\
**Post date:** [13 September 2019 16:22 UTC](https://discourse.nodered.org/t/installing-on-ubuntu-with-script/15515/21 "2019-09-13T16:22:10Z")

</div>

OK. Will do. Have to step away from this myself just now
