Issues installing node-red core

I've tried various ways to install node-red on my Raspberry PI 4 running Debian

It doesn't seem to install the core when I run the command line script

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

Running Node-RED install for user empiric-device at /home/empiric-device on debian

This can take 20-30 minutes on the slower Pi versions - please wait.

  • Stop Node-RED \u2714*
  • Remove old version of Node-RED \u2714*
  • Node option not specified : --node18 or --node20*
  • Leave existing Node.js : v20.4.0 Npm 9.7.2*
  • Clean npm cache -*
  • Install Node-RED core \u2718 *
  • Move global nodes to local -*
  • Leave existing nodes -*
  • Install extra Pi nodes \u2714*
  • Add shortcut commands \u2714*
  • Update systemd script \u2714*
  •                                  *
    

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 : Sun 04 Feb 2024 12:35:25 PM HST *
Finished: Sun 04 Feb 2024 12:36:10 PM HST


  • WARNING ###*

  • DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST*
  • Even if your Node-RED doesn't have anything valuable, (automated) attacks will*
  • happen and could provide a foothold in your local network*
  • Follow the guide at Securing Node-RED : 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*
    
    • You can customise the initial settings by running:*
  •  node-red admin init*
    
    • After running Node-RED for the first time, change the ownership of the settings*
  • file to 'root' to prevent unauthorised changes:*
  •  sudo chown root:root ~/.node-red/settings.js*
    

/dev/fd/63: line 813: node-red: command not found
chown: cannot access '/home/empiric-device/.node-red/settings.js': No such file or directory

Hello @dnguyen01123 , welcome to the forum.

  1. Just to clarify, your login on the Raspberry Pi is empiric-device?

  2. What do these commands show you?
    ls -al ~
    sudo df -h

  1. Have you looked for clues in this file?

  2. Try this to force a reinstallation of node.js:

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

If it works, you can repeat it but specifying --node20

Hi,

Thanks for responding, my comments to your questions are below:

  1. yes I'm installed as empiric-device
  2. ls -al ~
    empiric-device@gateway-pi-zau1mz:~ $ ls -al ~
    total 144
    drwxrwxrwx 20 empiric-device empiric-device 4096 Feb 4 14:57 .
    drwxr-xr-x 3 root root 4096 May 2 2023 ..
    -rw------- 1 empiric-device empiric-device 3567 Feb 4 14:57 .bash_history
    -rw-r--r-- 1 empiric-device empiric-device 220 May 2 2023 .bash_logout
    -rw-r--r-- 1 empiric-device empiric-device 3720 Jul 8 2023 .bashrc
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Bookshelf
    drwxr-xr-x 7 empiric-device empiric-device 4096 Jan 31 15:56 .cache
    drwx------ 14 empiric-device empiric-device 4096 Jan 31 16:58 .config
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Desktop
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Documents
    drwxr-xr-x 2 empiric-device empiric-device 4096 Jan 31 17:31 Downloads
    drwxr-xr-x 6 empiric-device empiric-device 4096 Jul 8 2023 empiric
    drwxr-xr-x 3 empiric-device empiric-device 4096 May 2 2023 .local
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Music
    drwxr-xr-x 53 empiric-device empiric-device 4096 Feb 4 13:32 node_modules
    drwxr-xr-x 4 empiric-device empiric-device 4096 Jul 8 2023 .npm
    -rw------- 1 empiric-device empiric-device 22 Feb 4 13:39 .npmrc
    drwxr-xr-x 8 empiric-device empiric-device 4096 Jan 31 16:41 .nvm
    -rw-r--r-- 1 empiric-device empiric-device 127 Feb 4 13:32 package.json
    -rw-r--r-- 1 empiric-device empiric-device 25363 Feb 4 13:37 package-lock.json
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Pictures
    drwx------ 3 empiric-device empiric-device 4096 Jan 31 15:56 .pki
    -rw-r--r-- 1 empiric-device empiric-device 807 May 2 2023 .profile
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Public
    drwx------ 2 empiric-device empiric-device 4096 Jul 8 2023 .ssh
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Templates
    drwxr-xr-x 2 empiric-device empiric-device 4096 May 2 2023 Videos
    -rw------- 1 empiric-device empiric-device 62 Feb 4 14:57 .Xauthority
    -rw------- 1 empiric-device empiric-device 2722 Feb 4 14:58 .xsession-errors
    -rw------- 1 empiric-device empiric-device 2603 Jan 31 17:59 .xsession-errors.old
    empiric-device@gateway-pi-zau1mz:~ $

sudo df -h

Filesystem Size Used Avail Use% Mounted on
/dev/root 59G 5.2G 51G 10% /
devtmpfs 1.7G 0 1.7G 0% /dev
tmpfs 1.9G 79M 1.8G 5% /dev/shm
tmpfs 759M 1.4M 758M 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
/dev/loop0 94M 94M 0 100% /snap/core/16204
/dev/loop1 70M 70M 0 100% /snap/core22/1035
/dev/mmcblk0p1 255M 33M 223M 13% /boot
tmpfs 380M 24K 380M 1% /run/user/1000
empiric-device@gateway-pi-zau1mz:~ $

  1. This is all I could get from the log file

Started : Sun 04 Feb 2024 01:39:17 PM HST

Running for user empiric-device at /home/empiric-device

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:armhf' is not installed, so not removed

0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Versions: node:v20.4.0 npm:9.7.2

Now install Node-RED

sudo: npm: command not found

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 :

added 28 packages in 6s

Now add the shortcut and start/stop/log scripts to the menu

Now add systemd script and configure it for empiric-device:empiric-device @ /home/empiric-device

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 empiric-device' is already a member of gpio'.

Leaving old rpi.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.2+b2).

0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Allow binding to low ports : n

Memory : 3.8G

Started : Sun 04 Feb 2024 01:39:17 PM HST

Finished: Sun 04 Feb 2024 01:39:45 PM HST

  1. when I force install using the codes it seems like it works , and then I did the v20 and this is what I got

nodered.service: Scheduled restart job, restart counter is at 2.

Stopped Node-RED graphical event wiring tool.

Started Node-RED graphical event wiring tool.

/usr/bin/env: 'node-red-pi': No such file or directory

nodered.service: Main process exited, code=exited, status=127/n/a

nodered.service: Failed with result 'exit-code'.

Your ls -al ~ output shows that /home/empiric-device is indeed the home directory but no .node-red directory has been created there. On the other hand, there is a node_modules directory, which I would expect to see inside .node-red.

I don't know what circumstances might lead to this result, I wondered if the root filesystem was full but df -h shows that it's not.

Did you run the install script using sudo? This might suggest that you did (but you should not have).

Now install Node-RED
sudo: npm: command not found

This is odd - seem like that although it reports the version of nodejs and npm (and thus can find the commands) it then seems to say it can't find them and fails to complete... I'm going to suggest retrying the script (again) but this time add the parameter --node20 to force the re-install of nodejs. Do this as your usual user (not root or sudo).

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