Had some problems with the recent Buster Lite and node-Red on a Rpi4 B, so decided to a fresh Raspberry Pi OS 64B Lite installation on a new SDCard. After the booting I installed the update/upgrade and now I can manage the Pi via SSH. Then I ran this script and before a poured the coffee, it was there, a new OS and node-RED installation. for that script.
After the node-RED installation I copied from the old to the nwe SDCard the files, package.json, flows_Rpi4_cred.json and flows_Rpi4.json and renamed them to the new hostname.
I restart nod-RED, but there are no flows and no nodes from my old installation.
Did I forgot something?
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.1.54: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
[sudo] password for Maru:
Starting as a systemd service.
^Z
[1]+ Stopped node-red-start
Maru@RPi4:~/.node-red $ npm install
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -2
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/Maru/.npm/_logs/2023-07-15T14_18_26_818Z-debug-0.log
I guess you didn't see the bit on the page you linked to:
"You may need to run sudo apt install build-essential git curl first to ensure npm is able to fetch and build any binary modules it needs to install"
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.1.54: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
[sudo] password for Maru:
Starting as a systemd service.
15 Jul 17:32:41 - [info]
Welcome to Node-RED
===================
15 Jul 17:32:41 - [info] Node-RED version: v3.0.2
15 Jul 17:32:41 - [info] Node.js version: v16.20.1
15 Jul 17:32:41 - [info] Linux 6.1.21-v8+ arm64 LE
15 Jul 17:32:43 - [info] Loading palette nodes
15 Jul 17:32:44 - [info] Settings file : /home/Maru/.node-red/settings.js
15 Jul 17:32:44 - [info] Context store : 'default' [module=memory]
15 Jul 17:32:44 - [info] User directory : /home/Maru/.node-red
15 Jul 17:32:44 - [warn] Projects disabled : editorTheme.projects.enabled=false
15 Jul 17:32:44 - [info] Flows file : **/home/Maru/.node-red/flows.json**
15 Jul 17:32:44 - [info] Creating new flow file
15 Jul 17:32:44 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
15 Jul 17:32:44 - [warn] Encrypted credentials not found
15 Jul 17:32:44 - [info] Starting flows
15 Jul 17:32:44 - [info] Started flows
15 Jul 17:32:44 - [info] Server now running at http://127.0.0.1:1880/
This is the output, still no flows and /home/Maru/.node-red/flows.json is not existing
Thank you @jbudd, I thought the same and I renamed them and started node-RED:
Maru@RPi4:~/.node-red $ ls -l
total 1520
-rw-r--r-- 1 Maru Maru 731951 Jul 15 19:01 flows.json
-rw-r--r-- 1 Maru Maru 6112 Jul 15 00:06 flows_RPi4_cred.json
-rw-r--r-- 1 Maru Maru 731951 Jul 15 00:07 flows_RPi4.json
drwxr-xr-x 3 Maru Maru 4096 Jul 14 22:56 lib
drwxr-xr-x 3 Maru Maru 40960 Jul 15 17:14 node_modules
-rw-r--r-- 1 Maru Maru 5074 Jul 15 00:08 package.json
-rw-r--r-- 1 root root 22614 Jul 14 22:56 settings.js
Maru@RPi4:~/.node-red $ cp flows_RPi4_cred.json flows_cred.json
Maru@RPi4:~/.node-red $ node-red-start
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.1.54: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.