# Error while updating to newer version of NR

**URL:** <https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141>\
**Category:** General\
**Created:** [13 December 2021 22:42 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141 "2021-12-13T22:42:52Z")\
**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:** [13 December 2021 22:42 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/1 "2021-12-13T22:42:52Z")

</div>

I finally decided to update a machine with this command:  
`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node14`

The `--node14` was because _it_ complained about node10 no longer being supported.

Then I see/get this.

```auto
Running Node-RED update 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 ✔ v10.17.0
head: cannot open '/tmp/node.tgz' for reading: No such file or directory
tar (child): /tmp/node.tgz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2          
tar: Error is not recoverable: exiting now
  Install Node.js for Armv6 ✘ Bad install: Node.js v10.17.0 Npm missing - Exit
  Add shortcut commands               
  Update systemd script               
                                      

Any errors will be logged to /var/log/nodered-install.log

```

The _important_ part (I think) is this from the log:

```auto
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'npm' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
The following package was automatically installed and is no longer required:
  libbluray2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
cp: cannot stat '/tmp/nodejs/*': No such file or directory
rm: cannot remove '/tmp/node.tgz': No such file or directory

Versions: node:v10.17.0 npm:missing

```

I don't want to blindly go on and `sudo apt autoremove`.

I'd prefer to check before I make a bad situation worse.  
😉

---

<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 December 2021 23:15 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/2 "2021-12-13T23:15:15Z")

</div>

Is the time and date correct on your pi ? Have you run the normal apt-get update first to make sure the base is is up to date as well ?

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [13 December 2021 23:17 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/3 "2021-12-13T23:17:15Z")

</div>

Also what version of raspbian are you running?

---

<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:** [13 December 2021 23:18 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/4 "2021-12-13T23:18:21Z")

</div>

Yes time/date is correct.

I found a link and I (seem to) have to remove/install `nodejs`  
This is a thing that has caught many people I am seeing. (Lots of questions/threads on this)

@hardillb Stretch. Yeah, I know...

---

<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:** [13 December 2021 23:27 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/5 "2021-12-13T23:27:56Z")

</div>

In the mean time I found this:

> [@Help Wanted - testing updated install script](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685/81?page=2):
>
> Okay so not sure why but the /var/log/nodered-install.log file is empty. But it seems that /var/log/nodered-install.log.1 has the valid information... Already have nodejs v14.17.0 OLD nodejs 14 : NEW nodejs : \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Started : Thu 29 Jul 2021 10:33:36 PM CEST Running for user debian at /home/debian Found global nodes: : WARNING: apt does not have a stable CLI interface. Use with caution in scripts. Reading package lists... Building dependency tree... Read…

But that doesn't work either. ☹

Or I am too stupid to see what commands I need to do.

---

<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:** [13 December 2021 23:35 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/6 "2021-12-13T23:35:10Z")

</div>

Sorry, I am 99% sure I've been here before.

(Shame on me)

But it seems strange there is no definitive instructions on how to do what I am doing.

I've searched and found a lot of people (smarter than me) having the same problem.  
No, I'm not blaming others, I'm just saying.

Scenario:  
The _machine_ works. Updates are.... a long time ago.  
I want to update.  
I have node `10` and it is now deprecated. Fair enough.  
But I can't find a _black and white_ **What to do to upgrade** anywhere.

So unless people are keeping their machines up to date, and miss a few versions and then want to update/grade: they seem to be at a disadvantage as the version they have is no longer supported.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [13 December 2021 23:36 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/7 "2021-12-13T23:36:34Z")

</div>

That's a different problem, they are using `n` which is a nodejs version manager like `nvm` (and NO you really shouldn't try either of those if you don't KNOW EXACTLY what you are doing)

It is very possible that the certs in stretch have expired or new certs are not present so HTTPS will just not work.

Stretch went EoL July 2020, bite the bullet and upgrade, you've already broken it

---

<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:** [13 December 2021 23:41 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/8 "2021-12-13T23:41:25Z")

</div>

Yes, I get it.

But I think the systems shouldn't make it any worse.

I ran the command (copied from the _official site_ on how to do it)  
It complained and said I have to use the `--version12,14,16` option.

Did that - maybe blindly/stupidly - and it only made things worse as it started to install then just fell apart.

So it was working - and now isn't - because the install script messed up and failed because the version was _too old_.  
Yeah, I've also been told how to upgrade from Stretch to ... Buster.  
These machines are _remote_ and it is painful getting the SD cards and....

Doing it insitue (spelling?) would be nice.  
Yes, risks are there.

Argh, it is painful being where I am with the upgrade.

Still, why aren't the command/s to update the `node` and `nodejs` to the latest versions easy to find?  
(And `npm`?)

---

<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:** [13 December 2021 23:47 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/10 "2021-12-13T23:47:41Z")

</div>

Sorry... I spoke a _pork pie_ It was `8.11.1` originally.

---

<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:** [13 December 2021 23:48 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/11 "2021-12-13T23:48:45Z")

</div>

So it would be handy if there was a clearly documented way to get NR working as it was before so I can at least have the machine as it was before.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [14 December 2021 00:07 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/12 "2021-12-14T00:07:06Z")

</div>

Because the latest version nodejs might only run on the newer versions of the OS, they were released after the OS version went EoL, so you REALLY are tempting fate.

Yes the script could possibly warn you upfront if you are on a dead OS and it might fail, but it's not failing because of anything we control as far as I can see and it's a fair assumption that you are running on an OS that not (that) EoL, trying to cover all the things that could stop working because the OS isn't getting updates isn't worth the return in investment for our limited available time. What you are doing is outside the "norm"

If the remote machines are that hard to update then you really need a local copy of the deployed image you can test on first and roll back when it breaks. Especially if these are in any way mission critical.

Getting you back to where you were might not be possible especially if curl/https won't work because the certs have expired.

If you have a version in nodejs installed (v10.x) using apt-get then you could try and install the old version of node-red using npm

E.g.

npm install -g node-red@1.2.x

Where 1.2.x is what ever version you were running before.

If npm is missing you should be able to install that with apt-get as well.

---

<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:** [14 December 2021 00:15 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/13 "2021-12-14T00:15:43Z")

</div>

Thanks.

Gonna power down and try some things.

I only have 1 monitor. ☹

---

<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:** [14 December 2021 02:29 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/14 "2021-12-14T02:29:37Z")

</div>

Good news / bad news. (of course)

The update to Buster worked. (Amazing)

But when I try to start NR, I get this on the screen:

```auto
 
Starting as a systemd service.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 9.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=killed, status=4/ILL
nodered.service: Failed with result 'signal'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 10.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=killed, status=4/ILL
nodered.service: Failed with result 'signal'.

```

It just keeps going.

Sorry, what is my next step?

Digging on the error I saw a reply saying that NR was incorrectly installed and doesn't need the `sudo` prefix.

I went back and checked. Not done. (Phew)  
So that is good.

But I am not closer to understanding what is happening.

---

<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:** [14 December 2021 02:52 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/15 "2021-12-14T02:52:43Z")

</div>

For the sake of putting more cards on the table:

This is the ownership in the `~.node-red/` directory.

```auto
pi@TelePi:~/.node-red $ ll
total 1480
drwxr-xr-x 2 pi pi 4096 Jul 15 2020 cronplusdata/
drwxr-xr-x 3 pi pi 4096 Oct 2 2017 lib/
drwxr-xr-x 253 pi pi 20480 Dec 14 13:15 node_modules/
drwxr-xr-x 6 pi pi 4096 Dec 1 21:37 public/
-rw-r--r-- 1 pi pi 128 Oct 27 21:59 flows_TelePi_cred.json
-rw-r--r-- 1 pi pi 1359322 Dec 13 23:53 flows_TelePi.json
-rw-r--r-- 1 pi pi 14913 Dec 14 11:20 npm-debug.log
-rw-r--r-- 1 pi pi 2154 Sep 25 19:13 package.json
-rw-r--r-- 1 pi pi 81709 Dec 14 13:15 package-lock.json
-rw-r--r-- 1 pi pi 11094 May 13 2021 settings.js

```

Though I don't know if the missing `x` is a problem. (Shrug)

---

<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:** [14 December 2021 03:26 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/16 "2021-12-14T03:26:56Z")

</div>

And something else that may not be helping:

(After running the install script)

 ![Screenshot from 2021-12-14 14-23-56](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ff6ceef2607ac0bb43cf4212b0f79baf2cf47da5.png)

`node -v`

```auto
pi@TelePi:~/.node-red $ node -v
v14.18.1
pi@TelePi:~/.node-red $ 

```

So that's good.

Is `nodejs` missing?

`sudo apt install nodejs`?

from a particular directory and `sudo`?

---

<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:** [14 December 2021 04:20 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/17 "2021-12-14T04:20:53Z")

</div>

Ok, now getting off topic a bit, but....

_Originally_ the CPU load (with NR running) was anything from 10 - 30%.

Now, NR **NOT** running the CPU load is at 100%. Maybe down to 95%.

`htop` doesn't show me much, even if I show `root` tasks.

 ![Screenshot from 2021-12-14 14-55-33](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/c/4c73b677a4df27523baba636135a7d8e02124509.png)

So I am confused what is happening.

 ![Screenshot from 2021-12-14 14-55-27](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/86fd0705754061b7a8f273e3b96e0a14ae4f3f4c.png)

---

<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:** [14 December 2021 07:36 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/18 "2021-12-14T07:36:17Z")

</div>

> [@Trying\_to\_learn](#):
>
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/6848e299e6de1296c438296f95d8236a14a7ecdb.png)
> 
> Is `nodejs` missing?

`nodejs` is not a thing. it is simply `node`

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/25a3165508254c83947f8183ff41ab58ef05af5c.png)

this was a successful installation

---

<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:** [14 December 2021 07:40 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/19 "2021-12-14T07:40:05Z")

</div>

Ok, but in other threads (and on my machines) when I do a `nodejs -v` I get a value.

Not the _Not found_ error.

Node-Red won't run/start.

See post 14.  
I've been down that rabbit hole and it is owned by me and not installed via/with `sudo`.

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

from `~/.node.red`

---

<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:** [14 December 2021 07:49 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/20 "2021-12-14T07:49:44Z")

</div>

> [@Trying\_to\_learn](#):
>
> Ok, but in other threads (and on my machines) when I do a `nodejs -v` I get a value.
> 
> Not the _Not found_ error.

Yeah, it seems to be an alternative

At a guess, older raspian os added this, newer os does not?

if you enter `sudo update-alternatives --config nodejs` you will see what it is pointing to.

In basic terms - use `node` forget about `nodejs`

---

<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:** [14 December 2021 07:56 UTC](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141/21 "2021-12-14T07:56:51Z")

</div>

Well, this is taken from a working machine with BUSTER.

```auto
pi@BedPi:~ $ sysinfo
Raspberry Pi 2 Model B Rev 1.1

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Raspberry Pi reference 2021-03-04
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 461109415073d2eb67083709662ba983cc191f14, stage5
Linux BedPi 5.10.17-v7+ #1414 SMP Fri Apr 30 13:18:35 BST 2021 armv7l GNU/Linux
pi@BedPi:~ $ nodejs -v
v12.22.1
pi@BedPi:~ $ node -v
v12.22.1
pi@BedPi:~ $ 

```

This is from the recently updated machine:

```auto
pi@TelePi:~ $ sysinfo
Raspberry Pi Zero W Rev 1.1

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Raspberry Pi reference 2017-09-07
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 496e41575eeb9fa13f394ffb407b7bc1d00b21c2, stage5
Linux TelePi 5.10.63+ #1496 Wed Dec 1 15:57:05 GMT 2021 armv6l GNU/Linux
pi@TelePi:~ $ nodejs -v
-bash: nodejs: command not found
pi@TelePi:~ $ node -v
v14.18.1
pi@TelePi:~ $ 

```

Alas just now it is painful on `telepi`.

After the update, CPU maxed out at `95 - 100%` all the time.

But (I have been chasing this since .... 09:00 today) and there are .... a lot of closed tabs in the history.

But reading recent posts on getting NR working, `nodejs -v` was mentioned quite a few times.

I can only compare one machine to the other.  
But as I just also said: the new machine is pretty much maxed out CPU load. ☹

[Next page](https://discourse.nodered.org/t/error-while-updating-to-newer-version-of-nr/55141.md?page=2)
