# Issues upgrading nodejs

**URL:** <https://discourse.nodered.org/t/issues-upgrading-nodejs/2282>\
**Category:** General\
**Created:** [14 August 2018 16:44 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282 "2018-08-14T16:44:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmuntean](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmuntean/32/1776_2.png) [@fmuntean](https://discourse.nodered.org/u/fmuntean)\
**Post date:** [14 August 2018 16:44 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/1 "2018-08-14T16:44:29Z")

</div>

I have run the following:  
apt install nodejs and got the v8  
apt list nodejs  
Listing... Done  
nodejs/stable,now 8.11.1~dfsg-2~bpo9+1 armhf [installed]

however when running node -v I still get:  
pi@DietPi:~ $ node -v  
v6.10.0

I have upgraded node-red to latest v0.19:  
sudo npm install -g --unsafe-perm node-red  
npm WARN deprecated mailparser@0.6.2: Mailparser versions older than v2.3.0 are deprecated  
npm WARN deprecated nodemailer@1.11.0: All versions below 4.0.1 of Nodemailer are deprecated. See [https://nodemailer.com/status/](https://nodemailer.com/status/)  
npm WARN deprecated mimelib@0.3.1: This project is unmaintained  
npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained  
npm WARN deprecated buildmail@2.0.0: This project is unmaintained  
/usr/local/bin/node-red -\> /usr/local/lib/node\_modules/node-red/red.js  
/usr/local/bin/node-red-pi -\> /usr/local/lib/node\_modules/node-red/bin/node-red-pi  
/usr/local/lib  
└── node-red@0.19.0

and node -v still reports v6

When I do:  
pi@DietPi:~/.node-red $ npm rebuild  
[..................] - : info using node@v6.10.0

Please help upgrading to the latest version on a raspberry 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:** [14 August 2018 17:14 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/2 "2018-08-14T17:14:57Z")

</div>

I suggest you first uninstall nodejs  
sudo apt remove nodejs  
then run the `bash <(curl` script from the pi installation docs to upgrade everything node-red related.  
[https://nodered.org/docs/hardware/raspberrypi](https://nodered.org/docs/hardware/raspberrypi)

---

<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:** [14 August 2018 17:19 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/3 "2018-08-14T17:19:59Z")

</div>

Note this is the dietpi distribution, not raspbian. May need @dceejay to confirm best practice on whether the script is expected to work of dietpi.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [14 August 2018 18:06 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/4 "2018-08-14T18:06:33Z")

</div>

Why don't you try to install using the Dietpi built in system - dietpi-software?

---

<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:** [14 August 2018 18:19 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/5 "2018-08-14T18:19:49Z")

</div>

Indeed. Diet pi should use the dietpi software installer

---

<div class="post-metadata">

**Author:** ![fmuntean](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmuntean/32/1776_2.png) [@fmuntean](https://discourse.nodered.org/u/fmuntean)\
**Post date:** [14 August 2018 18:39 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/6 "2018-08-14T18:39:57Z")

</div>

tried to use that and get error. I submitted a ticket there too.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [14 August 2018 18:46 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/7 "2018-08-14T18:46:03Z")

</div>

They probably need to update their install script to make sure that Nodejs is at version 8 for node-red 0.19. They are usually very responsive to posts.

---

<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:** [14 August 2018 19:05 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/8 "2018-08-14T19:05:13Z")

</div>

> [@ghayne](#):
>
> They probably need to update their install script to make sure that Nodejs is at version 8 for node-red 0.19. They are usually very responsive to posts.

Node-RED 0.19 supports Node 4.8 or later - but it will be the _last_ milestone release that supports anything before Node 8.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [14 August 2018 19:07 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/9 "2018-08-14T19:07:40Z")

</div>

Thanks Nick, I misread the release notes. Sorry for the confusion!

---

<div class="post-metadata">

**Author:** ![fmuntean](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmuntean/32/1776_2.png) [@fmuntean](https://discourse.nodered.org/u/fmuntean)\
**Post date:** [15 August 2018 00:26 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/10 "2018-08-15T00:26:17Z")

</div>

I was under the impression that I have to upgrade to nodejs v8.  
Please confirm that I can keep using nodejs v6 as it was not clear from the release notes

---

<div class="post-metadata">

**Author:** ![fmuntean](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmuntean/32/1776_2.png) [@fmuntean](https://discourse.nodered.org/u/fmuntean)\
**Post date:** [15 August 2018 01:19 UTC](https://discourse.nodered.org/t/issues-upgrading-nodejs/2282/11 "2018-08-15T01:19:33Z")

</div>

With help from DietPi support was able to upgrade nodejs to v8.11
