# Update Node.js 12.22.9 to latest version question

**URL:** <https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059>\
**Category:** General\
**Created:** [15 October 2022 11:46 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059 "2022-10-15T11:46:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![gschmidt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gschmidt/32/60349_2.png) [@gschmidt](https://discourse.nodered.org/u/gschmidt)\
**Post date:** [15 October 2022 11:46 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/1 "2022-10-15T11:46:41Z")

</div>

Hi,

On my Raspberry Pi 3b+ with Raspbian Buster I want to update Zigbee2mqtt to the latest version.  
However this version uses Nodejs 14 or higher and currently the raspberry pi runs Node-red 12.22.9

If I update Node-Red with the recommended command I get the message that this version needs 14 or higher

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

```

Now I have read that adding --node14 or --node16 will force to install Node-Red 3.0.  
and run `npm rebuild`

If I run this update, which version would be best: --node14 or --node16?

Are there any other steps that need to be taken to ensure that the update is successful?

Greetzzz

---

<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:** [15 October 2022 11:49 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/2 "2022-10-15T11:49:38Z")

</div>

> [@gschmidt](#):
>
> raspberry pi runs Node-red 12.22.9

This is not a valid node-red version. That looks like a Home Assistant version number.

You may need to disable the home assistant plugin before installing node-red using the official script installer

> [@gschmidt](#):
>
> If I run this update, which version would be best: --node14 or --node16?

`--node16`

---

<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:** [15 October 2022 11:52 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/3 "2022-10-15T11:52:44Z")

</div>

Ah hold on.

> [@gschmidt](#):
>
> However this version uses Nodejs 14 or higher and currently the raspberry pi runs Node-red 12.22.9

You mean `node-js` NOT node-red!

Ok, then proceed with

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

---

<div class="post-metadata">

**Author:** ![gschmidt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gschmidt/32/60349_2.png) [@gschmidt](https://discourse.nodered.org/u/gschmidt)\
**Post date:** [15 October 2022 11:56 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/4 "2022-10-15T11:56:44Z")

</div>

Oh sorry you're right I meant node-js  
I don't run Home Assistant but Domoticz instead along with Zigbee2MQTT  
Do I have to stop both Zigbee2mqtt and Domoticz services before running the command?

---

<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:** [15 October 2022 11:57 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/5 "2022-10-15T11:57:52Z")

</div>

No - should be fine.

---

<div class="post-metadata">

**Author:** ![gschmidt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gschmidt/32/60349_2.png) [@gschmidt](https://discourse.nodered.org/u/gschmidt)\
**Post date:** [15 October 2022 11:58 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/6 "2022-10-15T11:58:13Z")

</div>

Thanx I'll give it a try!

---

<div class="post-metadata">

**Author:** ![gschmidt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gschmidt/32/60349_2.png) [@gschmidt](https://discourse.nodered.org/u/gschmidt)\
**Post date:** [15 October 2022 12:07 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/7 "2022-10-15T12:07:31Z")

</div>

I see that the package also updates:  
npm rebuild existing nodes

Isn't that the same command that I mentioned (I have read in the forum) to perform after the installation: npm rebuild?

---

<div class="post-metadata">

**Author:** ![gschmidt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gschmidt/32/60349_2.png) [@gschmidt](https://discourse.nodered.org/u/gschmidt)\
**Post date:** [15 October 2022 12:10 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/8 "2022-10-15T12:10:15Z")

</div>

Looks like it was succesfully installed

```auto
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 ✔ v12.22.9
  Install Node.js 16 LTS ✔ v16.17.1 Npm 8.15.0
  Clean npm cache ✔
  Install Node-RED core ✔ 3.0.2
  Move global nodes to local -
  Npm rebuild existing nodes ✔
  Install extra Pi nodes ✔
  Add shortcut commands ✔
  Update systemd script ✔
                                      

Any errors will be logged to /var/log/nodered-install.log
All done.
You can now start Node-RED with the command node-red-start
  or using the icon under Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started : za 15 okt 2022 13:59:11 CEST 
Finished: za 15 okt 2022 14:08:29 CEST
 
You may want to run node-red admin init
to configure your initial options and settings.
 
pi@Domotica-Pi:~ $ node -v
v16.17.1
pi@Domotica-Pi:~ $

```

---

<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:** [15 October 2022 12:33 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/9 "2022-10-15T12:33:06Z")

</div>

> [@gschmidt](#):
>
> Isn't that the same command that I mentioned (I have read in the forum) to perform after the installation: npm rebuild?

Yes, the script does that for you. You only need to do it yourself if you manually install a different version of nodejs

---

<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:** [15 October 2022 17:28 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/10 "2022-10-15T17:28:14Z")

</div>

Title changed to reflect the actual question.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 December 2022 17:28 UTC](https://discourse.nodered.org/t/update-node-js-12-22-9-to-latest-version-question/69059/11 "2022-12-14T17:28:45Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
