node-red
node-red copied to clipboard
Project Clone From GitHub not working when node-red started as service
Current Behavior
On both versions 4.0.2 and 4.0.9 and the newest version of RaspberryPi OS dated 2025-05-13. This is a clean install of both. I get an error when I try to clone a project from GitHub. There is not a directory "/run/user/0".
An unexpected error occurred: listen EACCES: permission denied /run/user/0/node-red-git-askpass-b17c333040d9423f-sock code: EACCES
Expected Behavior
No response
Steps To Reproduce
Start Imager Select Raspberry Pi 4 Select Raspberry Pi OS (64 Bit) dated 2025-05-13 Install to storge device
Move SD card to Raspberry Pi 4 Set up network address
After Install sudo apt update sudo apt full-upgrade sudo reboot
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --allow-low-ports --node20 --confirm-pi --update-nodes --nodered-version="4.0.9"
sudo systemctl enable nodered.service
Example flow
None
Environment
- Node-RED version:4.0.2 or 4.0.9
- Node.js version: 20.19.2
- npm version:10.8.2
- Platform/OS: Raspberry Pi 4 / Raspberry Pi OS (64 Bit) dated 2025-05-13
- Browser: Windows 11 / Google Chrome Version 136.0.7103.114 (Official Build) (64-bit)
I would propose to set the user with the following option found on the installation script according to your system.
--nodered-user specify the user to run as, useful for installing as sudo - e.g. --nodered-user=pi
@FlameMetalsGitHub did you manage to solve this issue? I am running into the same problem.
Seeing the same problem running Node-RED 4.1.1 on a Pi 4, set up in the same way as described here (using the bash script)
Can somebody try the following (assuming running as pi and that uid for that user is 1000)
Create a file in ~pi/node-red called environment and add the following:
XDG_RUNTIME_DIR=/run/user/1000
Then restart the service and test again
Verified working! The file needs to be at ~/.node-red/environment (which is /home/pi/.node-red/environment) and needs to contain XDG_RUNTIME_DIR=/run/user/1000 (not sure if a following line break is required, but I added one just in case).
I wonder if this means that choosing Projects during the running of the installation bash script should result in ~/.node-red/environment being created, having XDG_RUNTIME_DIR=/run/user/1000 in it?
Having the install script do that is probably not a bad idea /cc @dceejay
Probably needs to be a bit smarter than just 1000 (e.g. should us uid to get the correct value for the user)
added to latest install script - hopefully it helps...