# Upgrade node-red on raspberry pi

**URL:** <https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846>\
**Category:** General\
**Created:** [31 October 2022 15:08 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846 "2022-10-31T15:08:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![henrik1](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@henrik1](https://discourse.nodered.org/u/henrik1)\
**Post date:** [31 October 2022 15:08 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/1 "2022-10-31T15:08:36Z")

</div>

Hi,  
Some time ago I installed Node Red on my Raspberry Pi Zero. I think it was Node Red version 1.2.9 or something like that. I have used it for "sandbox'ing" to test different things with ZigBee/MQTT/Tasmota/... and yesterday I needed to upgrade a library for a MQTT part, and it said, my Node Red installation was way out of date. So I started to upgrade...

The short version: I have upgraded nodejs to version 16.3.0, and tried the

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

```

to upgrade Node Red. But when the script has finished, Node Red does not work; When I run `node-red-start`

... I just get the message

```auto
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

sh: 0: getcwd() failed: No such file or directory
Node-RED is not yet fully installed. Please re-run the install script again manually.

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

then retry node-red-start

```

When looking in the log-file ( /var/log/nodered-install.log) it says:

```auto
If you want the installer to recreate the systemd script, please delete or rena$
ln: failed to create symbolic link '/usr/bin/python': File exists
Now add launcher to top bar, add cpu temp example, make sure ping works
The user pi' is already a member of gpio'.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
python3-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Allow binding to low ports : n
Memory : 530M
Started : Mon Oct 31 15:11:43 CET 2022
Finished: Mon Oct 31 15:20:53 CET 2022

```

I found a similar description here: [https://discourse.nodered.org/t/solved-node-red-v3-0-0-pi-installer-script-node-red-does-not-start-after-installer-is-finished-setting-js-no-such-file-or-directory/65085/2](https://discourse.nodered.org/t/solved-node-red-v3-0-0-pi-installer-script-node-red-does-not-start-after-installer-is-finished-setting-js-no-such-file-or-directory/65085/2) and have tried the solution with using `sudo npm install -g --unsafe-perm node-red` but it does not give me Node Red back.

Can someone give me a hint to what to try and what I miss in trying to upgrade?

/Henrik

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [31 October 2022 15:51 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/2 "2022-10-31T15:51:34Z")

</div>

@henrik1 welcome to the forum!

1. what OS do you have running on the Pi? (from the terminal run `lsb_release -c`)
2. What user did you run the install script under?
3. Did you runt the install script using 'sudo' (I hope not)
4. If you do a `cd $HOME/.node-red & ls -al`, do you get output showing files and do a
5. please run `cat /var/log/nodered-install.log` and copy and paste the results to a reply

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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:** [31 October 2022 16:17 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/3 "2022-10-31T16:17:47Z")

</div>

Also make sure that these commands succeed  
`sudo apt update`  
`sudo apt full-upgrade`

---

<div class="post-metadata">

**Author:** ![henrik1](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@henrik1](https://discourse.nodered.org/u/henrik1)\
**Post date:** [31 October 2022 18:11 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/4 "2022-10-31T18:11:09Z")

</div>

@Colin It says that all packages are up-to-date

@zenofmud Thank you for your reply. First regarding the quotes for showing code, That should be fixed now.

> [@](#):
>
> 1. what OS do you have running on the Pi? (from the terminal run `lsb_release -c`)

It says `Codename: buster`

> [@](#):
>
> 2. What user did you run the install script under?

The user is _pi_

> [@](#):
>
> 3. Did you runt the install script using 'sudo' (I hope not)

The first script `bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)` was run without `sudo` while the last one tried `sudo npm install -g --unsafe-perm node-red` was with `sudo`

> [@](#):
>
> 4. If you do a `cd $HOME/.node-red & ls -al`, do you get output showing files and do a

I get

```auto
[1] 4857
total 12
drwxr-xr-x 3 root root 4096 Jan 11 2021 .
drwxr-xr-x 18 root root 4096 Jan 11 2021 ..
drwxr-xr-x 9 pi pi 4096 Oct 30 21:06 pi
[1]+ Done cd $HOME/.node-red

```

> [@](#):
>
> 5. please run `cat /var/log/nodered-install.log` and copy and paste the results to a reply

I get

```auto
Already have nodejs v16.3.0
OLD nodejs 16 :
NEW nodejs :

***************************************

Started : Mon Oct 31 15:11:43 CET 2022
Running for user pi at /home/pi
Found global nodes: :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Versions: node:v16.3.0 npm:8.19.2
Now install Node-RED

added 8 packages, removed 15 packages, and changed 284 packages in 7m
3.0.2
Now create basic package.json for the user and move any global nodes
Installing extra nodes: node-red-node-pi-gpio@latest node-red-node-random@latest node-red-node-ping@latest node-red-contrib-play-audio@latest node-red-node-smooth@latest node-red-node-serialport@latest node-red-contrib-buffer-parser@latest :

up to date in 23s
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for pi:pi @ /home/pi
Customized systemd script found @ /lib/systemd/system/nodered.service. To prevent loss of modifications, we'll not recreate the systemd script.
If you want the installer to recreate the systemd script, please delete or rename the current script & re-run the installer.
ln: failed to create symbolic link '/usr/bin/python': File exists
Now add launcher to top bar, add cpu temp example, make sure ping works
The user `pi' is already a member of `gpio'.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
python3-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Allow binding to low ports : n
Memory : 530M
Started : Mon Oct 31 15:11:43 CET 2022
Finished: Mon Oct 31 15:20:53 CET 2022

```

---

<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:** [31 October 2022 20:52 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/5 "2022-10-31T20:52:09Z")

</div>

> [@henrik1](#):
>
> > [@](#):
> >
> > 1. If you do a `cd $HOME/.node-red & ls -al`, do you get output showing files and do a
> 
> I get
> 
> ```auto
> [1] 4857
> total 12
> drwxr-xr-x 3 root root 4096 Jan 11 2021 .
> 
> ```

Can you show us that again, including the line where you enter the command please?  
Also  
`echo $HOME`

---

<div class="post-metadata">

**Author:** ![henrik1](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@henrik1](https://discourse.nodered.org/u/henrik1)\
**Post date:** [1 November 2022 06:09 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/6 "2022-11-01T06:09:38Z")

</div>

Sure;

```auto
pi@homeautomatic:/home $ cd $HOME/.node-red & ls -al
[1] 4857
total 12
drwxr-xr-x 3 root root 4096 Jan 11 2021 .
drwxr-xr-x 18 root root 4096 Jan 11 2021 ..
drwxr-xr-x 9 pi pi 4096 Oct 30 21:06 pi
[1]+ Done cd $HOME/.node-red

```

And `echo $HOME`

```auto
pi@homeautomatic:~ $ echo $HOME
/home/pi

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 November 2022 06:56 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/7 "2022-11-01T06:56:15Z")

</div>

Oops, my mistake, there should be two `&` not one. Please run  
`cd $HOME/.node-red && ls -al`  
and copy/paste the results

and could you try the NR install using  
`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16`

This is what I got and you should see something similar:

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

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 ✔ v14.19.1
  Install Node.js for Armv6 ✔ v16.18.0 Npm 8.19.2
  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 - Skipped - existing script is customized.
                                      

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 : Tue 1 Nov 03:12:29 EDT 2022 
Finished: Tue 1 Nov 03:23:16 EDT 2022
 
Just FYI : Your settings.js file is different from the latest defaults.
You may wish to run
   diff -y --suppress-common-lines /usr/lib/node_modules/node-red/settings.js /home/pi/.node-red/settings.js
to compare them and see what the latest options are.
 
**********************************************************************************
 ### WARNING ###
 DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST
 
 Follow the guide at https://nodered.org/docs/user-guide/runtime/securing-node-red
 to setup security.
 
 ### ADDITIONAL RECOMMENDATIONS ###
  - Remove the /etc/sudoers.d/010_pi-nopasswd file to require entering your password
    when performing any sudo/root commands:
 
      sudo rm -f /etc/sudoers.d/010_pi-nopasswd
 
  - Change the ownership of its settings file to 'root' to prevent unauthorised changes:

      sudo chown root:root ~/.node-red/settings.js
 
**********************************************************************************

```

---

<div class="post-metadata">

**Author:** ![henrik1](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@henrik1](https://discourse.nodered.org/u/henrik1)\
**Post date:** [1 November 2022 15:46 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/8 "2022-11-01T15:46:38Z")

</div>

> [@zenofmud](#):
>
> Please run  
> `cd $HOME/.node-red && ls -al`  
> and copy/paste the results

```auto
pi@homeautomatic:~ $ cd $HOME/.node-red && ls -al
total 348
drwxr-xr-x 4 pi pi 4096 Oct 30 19:53 .
drwxr-xr-x 9 pi pi 4096 Oct 30 21:06 ..
-rw-r--r-- 1 pi pi 25570 Oct 30 19:53 .config.nodes.json
-rw-r--r-- 1 pi pi 26240 Oct 30 19:53 .config.nodes.json.backup
-rw-r--r-- 1 pi pi 95 Feb 6 2021 .config.runtime.json
-rw-r--r-- 1 pi pi 333 Feb 7 2021 .config.users.json
-rw-r--r-- 1 pi pi 331 Feb 7 2021 .config.users.json.backup
-rw-r--r-- 1 pi pi 21112 Oct 30 19:53 .flows_homeautomatic.json.backup
-rw-r--r-- 1 pi pi 432 Jul 18 2021 .flows_homeautomatic_cred.json.backup
-rw-r--r-- 1 pi pi 20992 Oct 30 19:53 flows_homeautomatic.json
-rw-r--r-- 1 pi pi 504 Jul 18 2021 flows_homeautomatic_cred.json
drwxr-xr-x 3 pi pi 4096 Feb 6 2021 lib
drwxr-xr-x 216 pi pi 12288 Oct 30 20:05 node_modules
-rw-r--r-- 1 pi pi 183252 Oct 31 15:20 package-lock.json
-rw-r--r-- 1 pi pi 783 Oct 30 20:06 package.json
-rw-r--r-- 1 pi pi 13261 Feb 6 2021 settings.js

```

> [@zenofmud](#):
>
> and could you try the NR install using  
> `bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16`

I did, and got the following

```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 ✔ v16.3.0
  Install Node.js for Armv6 ✔ v16.3.0 Npm 8.19.2
  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 - Skipped - existing script is customized.

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 : Tue Nov 1 16:28:00 CET 2022
Finished: Tue Nov 1 16:40:54 CET 2022

Just FYI : Your settings.js file is different from the latest defaults.
You may wish to run
   diff -y --suppress-common-lines /usr/lib/node_modules/node-red/settings.js /home/pi/.node-red/settings.js
to compare them and see what the latest options are.

**********************************************************************************
 ### WARNING ###
 DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST

 Follow the guide at https://nodered.org/docs/user-guide/runtime/securing-node-red
 to setup security.

 ### ADDITIONAL RECOMMENDATIONS ###
  - Remove the /etc/sudoers.d/010_pi-nopasswd file to require entering your password
    when performing any sudo/root commands:

      sudo rm -f /etc/sudoers.d/010_pi-nopasswd

  - Change the ownership of its settings file to 'root' to prevent unauthorised changes:

      sudo chown root:root ~/.node-red/settings.js

**********************************************************************************

```

But still, when I afterwards run `node-red-start` I get

```auto
pi@homeautomatic:~/.node-red $ node-red-start

Node-RED is not yet fully installed. Please re-run the install script again manually.

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

then retry node-red-start

```

---

<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:** [1 November 2022 17:22 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/9 "2022-11-01T17:22:51Z")

</div>

Most odd... the install looked good.  
What does ` which node ` report.  
You aren't using something like `nvm` or `n` to manage node version are you ?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 November 2022 17:36 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/10 "2022-11-01T17:36:29Z")

</div>

`-rw-r--r-- 1 pi pi 20992 Oct 30 19:53 flows_homeautomatic.json`  
Are you running Home Automation/Home Automation?  
If so, you should be running their install.

---

<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:** [1 November 2022 17:38 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/11 "2022-11-01T17:38:28Z")

</div>

> [@henrik1](#):
>
> But still, when I afterwards run `node-red-start` I get

I see that the install did not update your node red service file, as you had, apparently, already modified it. Can you show us what is in it please  
`cat /lib/systemd/system/nodered.service`

---

<div class="post-metadata">

**Author:** ![henrik1](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@henrik1](https://discourse.nodered.org/u/henrik1)\
**Post date:** [1 November 2022 18:47 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/12 "2022-11-01T18:47:22Z")

</div>

> [@dceejay](#):
>
> What does `which node` report.

```auto
/usr/sbin/node

```

> [@dceejay](#):
>
> You aren't using something like `nvm` or `n` to manage node version are you ?

I don't think I am using `nvm` or `n`. I don't recall using that.

> [@zenofmud](#):
>
> `-rw-r--r-- 1 pi pi 20992 Oct 30 19:53 flows_homeautomatic.json`  
> Are you running Home Automation/Home Automation?

If I recall it right, I choose the name _homeautomatic_ name myself.

> [@Colin](#):
>
> I see that the install did not update your node red service file, as you had, apparently, already modified it. Can you show us what is in it please  
> `cat /lib/systemd/system/nodered.service`

Sure, it shows

```auto
pi@homeautomatic:~ $ cat /lib/systemd/system/nodered.service
# systemd service file to start Node-RED

[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
Documentation=http://nodered.org/docs/hardware/raspberrypi.html

[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=pi
Group=pi
WorkingDirectory=/home/pi

Environment="NODE_OPTIONS=--max_old_space_size=256"
# uncomment and edit next line if you need an http proxy
#Environment="HTTP_PROXY=my.httpproxy.server.address"
# uncomment the next line for a more verbose log output
#Environment="NODE_RED_OPTIONS=-v"
# uncomment next line if you need to wait for time sync before starting
#ExecStartPre=/bin/bash -c '/bin/journalctl -b -u systemd-timesyncd | /bin/grep -q "systemd-timesyncd.* Synchronized to time server"'

ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
# Use SIGINT to stop
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
RestartSec=20
# Tag things in the log
SyslogIdentifier=Node-RED
#StandardOutput=syslog

[Install]
WantedBy=multi-user.target

```

---

<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:** [1 November 2022 21:05 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/13 "2022-11-01T21:05:04Z")

</div>

What model Pi is it (use `cat /proc/cpuinfo` to find out) and which version of the OS is it using (`cat /etc/os-release`)?

Does /usr/bin/node exist? If so what do this report  
`/usr/bin/node -v`  
Also  
`usr/sbin/node -v`  
`node -v`  
`apt policy nodejs`

---

<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:** [1 November 2022 21:17 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/14 "2022-11-01T21:17:34Z")

</div>

Yes. /usr/sbin/node is not the usual place for it to be installed so we need to understand that

---

<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:** [1 November 2022 21:26 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/15 "2022-11-01T21:26:52Z")

</div>

Something else that might be useful  
`dpkg -S /usr/sbin/node`

---

<div class="post-metadata">

**Author:** ![henrik1](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@henrik1](https://discourse.nodered.org/u/henrik1)\
**Post date:** [2 November 2022 15:07 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/16 "2022-11-02T15:07:17Z")

</div>

> [@Colin](#):
>
> What model Pi is it (use `cat /proc/cpuinfo` to find out

```auto
pi@homeautomatic:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2835
Revision : 9000c1
Serial : 000000005ad7f159
Model : Raspberry Pi Zero W Rev 1.1

```

> [@Colin](#):
>
> which version of the OS is it using (`cat /etc/os-release`)?

```auto
pi@homeautomatic:~ $ cat /etc/os-release
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"

```

> [@Colin](#):
>
> Does /usr/bin/node exist? If so what do this report  
> `/usr/bin/node -v`

```auto
pi@homeautomatic:~ $ /usr/bin/node -v
v16.18.0

```

> [@Colin](#):
>
> Also  
> `usr/sbin/node -v`

```auto
pi@homeautomatic:~ $ usr/sbin/node -v
-bash: usr/sbin/node: No such file or directory

```

> [@Colin](#):
>
> node -v

```auto
pi@homeautomatic:~ $ node -v
v16.3.0

```

> [@Colin](#):
>
> apt policy nodejs

```auto
pi@homeautomatic:~ $ apt policy nodejs
nodejs:
  Installed: (none)
  Candidate: 10.24.0~dfsg-1~deb10u2
  Version table:
     10.24.0~dfsg-1~deb10u2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages

```

> [@Colin](#):
>
> Something else that might be useful  
> `dpkg -S /usr/sbin/node`

```auto
pi@homeautomatic:~ $ dpkg -S /usr/sbin/node
dpkg-query: no path found matching pattern /usr/sbin/node

```

---

<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:** [2 November 2022 15:18 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/17 "2022-11-02T15:18:03Z")

</div>

> [@henrik1](#):
>
> > [@dceejay](#):
> >
> > What does `which node` report.
> 
> ```auto
> /usr/sbin/node
> 
> ```

Is that still the case, or was it a typo?

---

<div class="post-metadata">

**Author:** ![henrik1](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@henrik1](https://discourse.nodered.org/u/henrik1)\
**Post date:** [2 November 2022 15:37 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/18 "2022-11-02T15:37:36Z")

</div>

That is still correct. I get `/usr/sbin/node`

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 November 2022 17:48 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/19 "2022-11-02T17:48:55Z")

</div>

If I was you, I would copy the .node-red directory and it’s sub directories to usb drive. I would then uninstall node.js (note you have 16.3.0 while my install got 16.18.0).  
I would then run

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

```

And see if it installs node.js v16.18.0 and try running 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:** [2 November 2022 17:58 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846/20 "2022-11-02T17:58:20Z")

</div>

> [@henrik1](#):
>
> I get `/usr/sbin/node`

Can you run  
`which node`  
then  
`/usr/sbin/node -v`  
`ls -l /usr/sbin/node`  
and copy/paste that whole sequence here, including the lines where you enter the commands please.

[Next page](https://discourse.nodered.org/t/upgrade-node-red-on-raspberry-pi/69846.md?page=2)
