[solved] Node-Red Directories in Root?

Hi. I've just installed node-red on a fresh Raspbian Buster installation on an RPi4. Based on posts I've read, I thought node-red was supposed to run somewhere outside of the root. However, when I start my server, I see that it is looking at /root/.node-red/settings.js for my settings file, /root/.node-red for my user directory, and /root/.node-red/flows_raspberrypi.json for my flows file. Is all of that correct? I thought it was supposed to be using copies somewhere in the user space.


How did you install node-RED?
Did you use the recommended installation script for Raspberry Pi's?

Yessir. From that exact page.

I'm working on another fresh Raspbian install to try again.

Reinstall done.


Same results.

Any thoughts? Is this the way it's supposed to be and I'm worried over nothing?

The reason I ask is because yesterday, I did an install on a different RPi (an RPi3). I then installed EasyMIDI and node-red-contrib-midi-windows via NPM. I updated functionGlobalContext in the /home/pi/.node-red/settings.js file and I was able to use EasyMIDI functions. Everything was working well until it wasn't (different, non node-red issue), and I had to re-image that installation. After reinstalling everything (including node-red), and updating I found I couldn't reference EasyMIDI anymore via global.get() anymore.

That's when I decided to start over from scratch, yet again, but this time on a different machine: the RPi4. I tried updating /home/pi/.node-red/settings.js, but, once again, I couldn't reference EasyMIDI with global.get(). It just kept returning 'undefined'. Searching around, I found a forum post here that talked about watching where node-red was looking for the settings file on startup and that it should be looking somewhere in the user directories. That's when I noticed that my install was looking under /root/.node-red.

Like I said, any thoughts?

Thanks, in advance.

Nevermind. I figured it out. I was running node-red-start under sudo. Running without sudo solved my issue.

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