# Wanting to update node on Ubuntu. Docs confusing

**URL:** <https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438>\
**Category:** General\
**Created:** [26 November 2019 08:24 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438 "2019-11-26T08:24:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 08:24 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/1 "2019-11-26T08:24:00Z")

</div>

(Yes, I know I have asked before. And I am again asking.)

It is a double edge sword for me that if I write something down as being _the way to do it_ chances are it will be updated and/or changed.

I am running NR on Ubuntu 18.04 LTS and my node version is old.  
(Well, I am still running pre 1 Node Red)

Anyway, following the rabbit hole of docs I found this:  
[How to update NODE](https://nodered.org/docs/faq/node-versions)

Yes, I know it says **node.js** and I am talking **node**.

Anyway, towards the bottom of the screen:

> ### Upgrading Node.js

> If you change the version of Node.js you are using, you may need to rebuild Node-RED’s dependencies as well as any nodes you have installed. This is because some of them contain binary components that must be rebuilt to be compatible with the new Node.js version.

> This can be done using the command `npm rebuild` - but it must be run in the right directory.

> There are two places it should be run:

> 1. In your Node-RED user directory, `~/.node-red` - this is where any additional nodes you have installed are.
> 2. In the directory you installed Node-RED

> If you installed Node-RED as a global module and are not sure where that put it, you can use the command `npm list -g --depth 0` to find where your global modules are installed.

Fantastic. So I need to be in ~/.node-red

Ran the command, a squillion lines of stuff flew past. ( `npm rebuild`)

`node -v` Same as before.

Sorry, but I am still not getting it.

This isn't going to help my credibility, but.....

In those docs:

> There are two places it should be run:

COULD be run.

Should implies it has be run twice.

---

<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:** [26 November 2019 08:36 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/2 "2019-11-26T08:36:10Z")

</div>

> [@Trying\_to\_learn](#):
>
> If you change the version of Node.js you are using, you may need to rebuild Node-RED’s dependencies as well

These docs are telling you what you need to do _after_ you have updated node.js. They don't tell you how to update node.js. That will depend on how you installed it originally and what instructions you followed then.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 09:11 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/3 "2019-11-26T09:11:07Z")

</div>

Ok, so if I used the stated "use this script to install NR" I am still not getting what I need to do.

Command:  
`bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)`  
To the best of my knowledge.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [26 November 2019 09:27 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/4 "2019-11-26T09:27:51Z")

</div>

Update node(.js) - use google to determine how.  
Rebuild.  
Run the node-red install script.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 09:30 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/5 "2019-11-26T09:30:27Z")

</div>

My understanding is if I run the script (mentioned above) it updates the entire NR system.

I'm running 0.20.8 but my node version is a bit dated.

So I want to update the node part - if possible.

---

<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:** [26 November 2019 09:40 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/6 "2019-11-26T09:40:12Z")

</div>

Is it node-red or node (ie node.js or nodejs) that you want to update?  
Which version of nodejs do have after running the script?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 09:41 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/7 "2019-11-26T09:41:44Z")

</div>

who/what ever it is that is shown when I do:

`node -v`

---

<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:** [26 November 2019 09:46 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/9 "2019-11-26T09:46:12Z")

</div>

Well, as I asked before, what does it show?  
Also what version do you want?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 09:48 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/10 "2019-11-26T09:48:15Z")

</div>

```auto
me@me-desktop:~/.node-red$ node -v
v8.16.2
me@me-desktop:~/.node-red$ 

```

---

<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:** [26 November 2019 09:53 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/11 "2019-11-26T09:53:42Z")

</div>

That is a supported version of nodejs which I assume is why the script does not update it. If you uninstall that and then run the script again it should install 12.x I think.  
Probably you can uninstall it by running this, though it does depend on how it was installed initiall. The `rm` command may fail if the file is not present, but that doesn't matter.

```auto
sudo apt-get remove nodejs
sudo rm /etc/apt/sources.list.d/nodesource.list

```

After running those then `node -v` should say command not found, so then run the script again.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 09:57 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/12 "2019-11-26T09:57:40Z")

</div>

I'm an idiot.

Which script?

I am not wanting to update Node-Red yet. When the new version was released I asked about the merits of updating and I was advised against doing it. So for now I won't.

But I would like to keep other things up to date. (If possible.)  
I did the two commands and so `node -v` does give an error.

---

<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:** [26 November 2019 10:02 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/13 "2019-11-26T10:02:56Z")

</div>

Just read again the earlier threads and see you don't want to run the bash curl install script, I initially thought you had already done that. To install a specific version of nodejs (I did ask but you didn't tell us which one you want) see

> **[Installing Node.js Tutorial: Ubuntu](https://nodesource.com/blog/installing-node-js-tutorial-ubuntu/)**
>
> Install Node.js on Ubuntu in this quick tutorial that will get you up and running on your way to building Node.js applications.

  
Obviously replace the 6 with the version you want. You might also want to look at  
[https://nodered.org/docs/faq/node-versions](https://nodered.org/docs/faq/node-versions)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 10:26 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/14 "2019-11-26T10:26:39Z")

</div>

Colin,

I am very sorry I am not making sense. Believe me, it worse for me than you.

> [@Colin](#):
>
> Obviously replace the 6 with the version you want. You might also want to look at  
> [Supported Node versions : Node-RED](https://nodered.org/docs/faq/node-versions)

Yes, with you sort of there.

But it says `npm rebuild`.  
No version mentioned.

Looking at the table on the `Node.js Tutorial: Ubuntu.` Does NR 0.20.5 support version 12.x?  
(But again, I am failing to see where to enter the version number when all I can resolve from the page is `npm rebuild`. Which is to be run in the ~/.node-red directory.)

---

<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:** [26 November 2019 10:30 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/15 "2019-11-26T10:30:25Z")

</div>

The first link tells you how to install a specific version, in the black box at the beginning. But if you don't know which version you want to install then that is a completely different question. Why do you want to upgrade nodejs but not node-red? It doesn't make sense.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 10:36 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/16 "2019-11-26T10:36:52Z")

</div>

Well, I am at a loss to answer why I don't want to update NR.

I just remember that when it was released and I asked about updating it, someone posted an advisory against me doing it.  
(Not having a go at whom ever that is/was.)

I seem good at messing things up - I am sure you can attest to that.  
Maybe it was a precautionary thing. I can't honestly say.

But in a more recent post (the new dashboard and multicolour gagues) I said I only get 5 colours even when I click the 2 colour box.

I posted the versions I have and @hotNipi (I think) said my node version was a bit dated.  
So I thought I would at least get that up to date.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 10:39 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/17 "2019-11-26T10:39:56Z")

</div>

Ok, putting the _bullet in my mouth_ and trying:

```auto
me@me-desktop:~/.node-red$ $ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
[sudo] password for me: $: command not found

me@me-desktop:~/.node-red$ 

```

I pressed ^C when I saw the `command not found`.

So I am really missing something (else?) also.

---

<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:** [26 November 2019 10:45 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/18 "2019-11-26T10:45:53Z")

</div>

> [@Trying\_to\_learn](#):
>
> So I am really missing something (else?) also.

The dollar sign is the prompt that is already there, don't put that in. I thought the post you mentioned was saying the the old node-red version was likely to be the problem.  
I think you would probably be best just to run the pi install script to get a consistent set of everything. The advice not to upgrade was, I guess, just after the new node-red was released, at which point there were a few teething difficulties. I have upgraded all my systems without a single problem.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 10:50 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/19 "2019-11-26T10:50:36Z")

</div>

Thanks for catching the `$`.  
I cut too much from the example screen.

Rolling out the new NR to the RPIs is going to be slow and painful.  
That may be for a new day when I have more time to study things better.

For now I would be happy to get it on the NUC (Ubuntu 18.04) to get a feeling for it.

---

<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:** [26 November 2019 10:52 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/20 "2019-11-26T10:52:30Z")

</div>

You should hardly notice any difference.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 November 2019 10:54 UTC](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438/21 "2019-11-26T10:54:41Z")

</div>

Thanks. (Again)

Maybe tomorrow for both types.

I'm now stuck on another project and building messages.  
I really should get my act together with .... (sorry. I'm ranting.)

[Next page](https://discourse.nodered.org/t/wanting-to-update-node-on-ubuntu-docs-confusing/18438.md?page=2)
