# Non-starting Node-RED on my RPI

**URL:** <https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510>\
**Category:** General\
**Created:** [30 June 2023 17:12 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510 "2023-06-30T17:12:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![cybix](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cybix](https://discourse.nodered.org/u/cybix)\
**Post date:** [30 June 2023 17:12 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/1 "2023-06-30T17:12:10Z")

</div>

I havent got the "Manage Palette" option, just recently went from 1.x to 3.

Read something about that it had to do with old npm so I followed some commands...  
Now I am stuck with at non starting Node-RED installation on my Pi.

This is from my log

```auto
pi@RaspGreen:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://10.16.0.31:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
Started Node-RED graphical event wiring tool.
node-pre-gyp info This Node instance does not support builds for Node-API version 3
/usr/lib/node_modules/node-red/node_modules/fs-extra/lib/empty/index.js:13
  } catch {
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.

```

Where could I go from here?

---

<div class="post-metadata">

**Author:** ![MecatronicaMADE](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@MecatronicaMADE](https://discourse.nodered.org/u/MecatronicaMADE)\
**Post date:** [30 June 2023 17:18 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/2 "2023-06-30T17:18:40Z")

</div>

> [@cybix](#):
>
> just recently went from 1.x to 3.

Hi @cybix and welcome to community, What was way you updated 1.x to 3? Try with this command from Node-RED official page:

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

```

This script will:

- remove the existing version of Node-RED if present.
- if it detects Node.js is already installed, it will ensure it is at least v14. If less than v14 it will stop and let the user decide whether to stay with Node-RED version 1 - or upgrade Nodejs to a more recent LTS version. If nothing is found it will install the Node.js 16 LTS release using the [NodeSource](https://github.com/nodesource/distributions/blob/master/README.md) package.
- install the latest version of Node-RED using npm.
- optionally install a collection of useful Pi-specific nodes.
- setup Node-RED to run as a service and provide a set of commands to work with the service.

---

<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:** [30 June 2023 17:22 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/3 "2023-06-30T17:22:21Z")

</div>

> [@cybix](#):
>
> I havent got the "Manage Palette" option

This suggests NPM is not installed.

What do you get if you run `npm -v` and `node -v`

> [@cybix](#):
>
> just recently went from 1.x to 3

did you use the [official script](https://nodered.org/docs/getting-started/raspberrypi#installing-and-upgrading-node-red)?

Additionally, did you include the CLI option to upgrade Node.js to v16 or greater?

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

---

<div class="post-metadata">

**Author:** ![cybix](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cybix](https://discourse.nodered.org/u/cybix)\
**Post date:** [1 July 2023 07:24 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/4 "2023-07-01T07:24:59Z")

</div>

Thanks for the welcome!  
Have to admit that I cant remember how I did the upgrade, it was a month ago and everything seemed fine, just recently noticed the palette missing.

I now have runned the script and it ended with a "you are on node v8, if you still want to run that, downgrade your node-red to 1 or 2". So probably didnt do the upgrade complete/correct.

---

<div class="post-metadata">

**Author:** ![cybix](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cybix](https://discourse.nodered.org/u/cybix)\
**Post date:** [1 July 2023 07:27 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/5 "2023-07-01T07:27:34Z")

</div>

Here are my versions:

pi@RaspGreen:~ $ npm -v  
1.4.21  
(node:17862) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.  
pi@RaspGreen:~ $ node -v  
v8.11.1

So I have npm, it seems, I think I have installed it while trying to fix things yesterday, but the node seems outdated.

I have started the script again, now with the addition of --node16, its currently running.

Thanks to both of you with so swift and helpful comments!

---

<div class="post-metadata">

**Author:** ![cybix](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cybix](https://discourse.nodered.org/u/cybix)\
**Post date:** [1 July 2023 08:00 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/6 "2023-07-01T08:00:09Z")

</div>

Hmm, seems that I have another problem as well. The script ran fine until installation of npm (I think) then I got this error:

sudo: /usr/bin/sudo måste ägas av uid 0 och ha setuid-biten inställd

I think you understand although its in swedish. I checked the ownership and it is indeed pi who owns it (and all other files in /usr/bin but that might be right?).

While reading up on it I read that this might be a solution:  
`chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo`  
It also said I were to log in as root instead of pi and now it seems I dont know my root password....

This is turning into a mess. Maybe I should just reinstall the raspberry from start?  
If so, can I just keep my flows-file and put it in place in a fresh install?

This raspberry are only for measuring wheather, I do have another "main" node-red installation done with docker. But does'nt it seems to be overkill to run docker on the raspberry?

---

<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 July 2023 08:44 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/7 "2023-07-01T08:44:31Z")

</div>

> [@cybix](#):
>
> Maybe I should just reinstall the raspberry from start

Almost certainly there is no need for that. You have a very old version of nodejs. To tell the install script to install a recommended version use the command  
`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16`

First it is a good idea to run  
`sudo apt update && sudo apt full-upgrade`  
to make sure all the system packages are up to date.

If the node red script doesn't work then post the install log here (/var/log/nodered-install.log)

You should have your flows file and other data backed up in case of disaster. You should back the complete ~/.node-red folder, except for the node\_modules folder, which can be easily recreated if necessary.

---

<div class="post-metadata">

**Author:** ![cybix](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cybix](https://discourse.nodered.org/u/cybix)\
**Post date:** [1 July 2023 17:48 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/8 "2023-07-01T17:48:02Z")

</div>

I am kinda stuck, but its not a nodered problem anymore.  
**I can't use 'sudo'**

Have tried to switch to root but its probably not active (or I have forgotten passwd), but all demands sudo to work. Read about someone who took the sd-card out, mounted it on another computer and chown:ed /usr/bin and got it to work that way. I might reinstall after all.

---

<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 July 2023 19:23 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/9 "2023-07-01T19:23:08Z")

</div>

> [@cybix](#):
>
> I can't use 'sudo'

Why not?

What happens when you run the script to install node red?

---

<div class="post-metadata">

**Author:** ![cybix](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cybix](https://discourse.nodered.org/u/cybix)\
**Post date:** [1 July 2023 19:33 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/10 "2023-07-01T19:33:43Z")

</div>

> [@Colin](#):
>
> bash \<(curl -sL [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)) --node16

Half way through the script (I have node 16.20.1 now, this installed before the error) I get the error with:

"sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid-bit set"

The rest of the script fails with that error (like 20 times).

If I just run 'sudo' now, I get this error. If I look at the rights for /usr/bin its owned by 'pi', but I cant change that because I cant run sudo.

---

<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 July 2023 20:19 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/11 "2023-07-01T20:19:20Z")

</div>

So your system is messed up. Maybe it would be best to reinstall the os. Don't forget to backup the .node-red folder.

How did you manage to update nodejs without using sudo?

---

<div class="post-metadata">

**Author:** ![cybix](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@cybix](https://discourse.nodered.org/u/cybix)\
**Post date:** [1 July 2023 23:15 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/12 "2023-07-01T23:15:24Z")

</div>

> [@Colin](#):
>
> g

I ran the script just as you wrote, without sudo. Seemed to work fine in the first half, and node did install fine. But, as I said in the middle of the script the error kept coming.

You put it well, the os is messed up, I will reinstall OS, and I close this thread. Thanks for the help!

---

<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:** [15 July 2023 23:16 UTC](https://discourse.nodered.org/t/non-starting-node-red-on-my-rpi/79510/13 "2023-07-15T23:16:17Z")

</div>

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