[solved] Node-red v3.0.0, PI installer script - node-red does not start after installer is finished (setting.js 'No such file or directory')

TLDR: NOTE: The bash script has been fixed and now works.

Just installed V3.0.0 on a Pi model 3B V1.2 and ran the 'diff' to compare the settngs.js files and get this:

Just FYI : Your settings.js file is different from the latest defaults.
You may wish to run
    diff -y --suppress-common-lines /usr/lib/node_modules/node-red/settings.js /home/pi/.node-red/settings.js
to compare them and see what the latest options are.
**pi@testpi**:**~ $** diff -y --suppress-common-lines /usr/lib/node_modules/node-red/settings.js /home/pi/.node-red/settings.js
diff: /usr/lib/node_modules/node-red/settings.js: No such file or directory

looks like there is an install issue. When I try to start NR I get

pi@testpi:/ $ node-red-start

Node-RED is not yet fully installed. Please re-run the install script again manually.
 
   bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
 
then retry  node-red-start
pi@testpi:/ $ 

Hi Paul. Can you show us the install log from the initial run of the installer script?

bin playing some more. I reinstalled v2.2.2 with
sudo npm install -g --unsafe-perm node-red@2.2.2 and it installed fine, ran and. so I tried
sudo npm install -g --unsafe-perm node-red' and it runs and /usr/lib/node_modules/node-redis populated:
pi@testpi:/usr/lib/node_modules/node-red $ ls
bin CHANGELOG.md lib LICENSE node_modules package.json README.md red.js settings.js

So I ran the same command with out the version and get this:

pi@testpi:/usr/lib/node_modules/node-red $ sudo npm install -g --unsafe-perm node-red
/usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
/usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi

  • node-red@3.0.0
    added 9 packages from 10 contributors, removed 16 packages, updated 40 packages and moved 1 package in 43.533s

    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
    โ”‚ โ”‚
    โ”‚ New major version of npm available! 6.14.17 โ†’ 8.14.0 โ”‚
    โ”‚ Changelog: Release v8.14.0 ยท npm/cli ยท GitHub โ”‚
    โ”‚ Run npm install -g npm to update! โ”‚
    โ”‚ โ”‚
    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

pi@testpi:/usr/lib/node_modules/node-red $ ls

and there is nothing in it.

This or something else?

Running Node-RED install for user pi at /home/pi on raspbian


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

  Stop Node-RED                       โœ”
  Remove old version of Node-RED      โœ”
  Node option not specified           :   --node14, --node16, or --node18
  Leave existing Node.js              :   v14.20.0   Npm 6.14.17
  Clean npm cache                     -
  Install Node-RED core               โœ”   3.0.0 
  Move global nodes to local          -
  Leave existing nodes                -
  Install extra Pi nodes              โœ”
  Add shortcut commands               โœ”
  Update systemd script               โœ”
                                      

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 :  Thu 14 Jul 2022 06:21:49 AM EDT 
Finished:  Thu 14 Jul 2022 06:23:11 AM EDT
 
Just FYI : Your settings.js file is different from the latest defaults.
You may wish to run
   diff -y --suppress-common-lines /usr/lib/node_modules/node-red/settings.js /home/pi/.node-red/settings.js
to compare them and see what the latest options are.
 
pi@testpi:/ $ node-red
-bash: node-red: command not found

@Steve-Mcl if I install using sudo npm install -g --unsafe-perm node-red it works, /usr/lib/node_modules/node-red is populated

pi@testpi:/usr/lib/node_modules/node-red $ ls
bin  CHANGELOG.md  lib  LICENSE  node_modules  package.json  README.md  red.js  settings.js
pi@testpi:/usr/lib/node_modules/node-red $ 

and the diff works.

That one I think.

1 Like

@Steve-Mcl Here is the log, I reinstalled using the bash script and NR will not start

pi@testpi:~ $ cat /var/log/nodered-install.log
Already have nodejs v14.20.0
OLD nodejs 14 :
NEW nodejs  :

***************************************

Started : Thu 14 Jul 2022 06:59:41 AM EDT
Running for user pi at /home/pi
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' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Versions: node:v14.20.0 npm:6.14.17
Now install Node-RED 
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN node-red-contrib-mp4frag@0.1.0-beta.4 requires a peer of socket.io@2 || 3 || 4 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-contrib-ui-mp4frag@0.1.0-beta.3 requires a peer of node-red-dashboard@^2.26.1 but none is installed. You must install peer dependencies yourself.
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

+ node-red@3.0.0
updated 1 package in 15.789s
3.0.0 
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 :
npm WARN expo-random@12.1.2 requires a peer of expo@* but none is installed. You must install peer dependencies yourself.
npm WARN node-red-contrib-ui-mp4frag@0.1.0-beta.3 requires a peer of node-red-dashboard@^2.26.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-securerandom@0.1.1 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.

+ node-red-node-random@0.4.0
+ node-red-node-ping@0.3.1
+ node-red-contrib-play-audio@2.5.0
+ node-red-node-smooth@0.1.2
+ node-red-node-serialport@1.0.1
+ node-red-node-pi-gpio@2.0.4
updated 6 packages in 28.993s
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for pi:pi @ /home/pi
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 `pi' is already a member of `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.1~bpo10+4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Memory  : 971M
Started :  Thu 14 Jul 2022 06:59:41 AM EDT 
Finished:  Thu 14 Jul 2022 07:01:00 AM EDT
pi@testpi:~ $ 

See also Node-Red v3.0.0 Pi - Node-RED is not yet fully installed

busy looking into it (slow on a PI 3b)

Progress...
image

Just a hint, if you have VSCode installed, you can do a diff in it and edit your copy directly.

@TotallyInformation Jullian, the problem is the install didn't work :grimacing:

Same problem Paul

Could you please raise issue on the installer repo (if you can)?

done: Installer bash script fails to install node-red V3.0.0 ยท Issue #31 ยท node-red/linux-installers ยท GitHub

1 Like

Yup, I got that, I've always taken care to do a diff on the settings file - at least for major updates - been caught out on that in the past.

1 Like

If anyone is will to try, please update NPM to latest and re-run script.

The script has been changed to use --location=global but I suspect earlier versions node/npm doesnt like that?

It may even be enough to specify the --node14 or --node16 parameter (since that will re-install node/npm)

UPDATE: Dave has kindly revered the to -g for now. You should be able to re-run the installer script.

You may see notices about --global being depreciated - it is only a warning.

For the time being, "things" should work correctly now.

The bash script is now working again!!
This pi was using node.js v14.20.0 and I ran the script with no extra options.
The 'diff' works and Node-red starts:

pi@testpi:~ $ node-red
14 Jul 08:34:39 - [info] 

Welcome to Node-RED
===================

14 Jul 08:34:39 - [info] Node-RED version: v3.0.0
14 Jul 08:34:39 - [info] Node.js  version: v14.20.0
14 Jul 08:34:39 - [info] Linux 5.10.63-v7+ arm LE
14 Jul 08:34:40 - [info] Loading palette nodes
14 Jul 08:34:49 - [info] Worldmap version 2.26.1
14 Jul 08:34:49 - [info] Dashboard version 3.1.6 started at /ui
14 Jul 08:34:51 - [info] Settings file  : /home/pi/.node-red/settings.js
14 Jul 08:34:51 - [info] Context store  : 'default' [module=memory]
14 Jul 08:34:51 - [info] User directory : /home/pi/.node-red
14 Jul 08:34:51 - [info] Projects directory: /home/pi/.node-red/projects
14 Jul 08:34:51 - [info] Server now running at http://127.0.0.1:1880/
14 Jul 08:34:51 - [info] Active project : 00-bret-sensehat
14 Jul 08:34:51 - [info] Flows file     : /home/pi/.node-red/projects/00-bret-sensehat/flow.json
14 Jul 08:34:51 - [warn] Using unencrypted credentials
14 Jul 08:34:51 - [info] Starting flows

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