I cant really tell how I upgraded as I tried so many things because I couldn’t get things working at first.
But I don’t think, I’ve used your script.
Version are :
v9.11.1 for nodejs.
5.6.0 for npm.
I’ll have a deeper look at your doc.
I have the same problem and could not finde a solution. Maybe there is a lak of understanding in linux things?
Situation:
the command ./node-red works to start, but node-red-start fails with the folowing error. To be able to start the Node-RED independend while booting the Raspi, I need to get it working with node-red-start.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
nodered.service: Start request repeated too quickly.
Failed to start Node-RED graphical event wiring tool.
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
Versions
[info] Node-RED version: v0.18.7
[info] Node.js version: v8.11.3
[info] Linux 4.9.41-v7+ arm LE
Hardware: RPi3
what I did
I installed Node-RED somehow some days ago and started playing arround. Becaus I didn't had a entry in a menue like in a tutorial, I desided to upgrade to the newest version of node-RED, what I hadn't. The Upgrade I did with the folowing line.
Script
This I forgot to mention. The folowing line finishes with a "+". In this part, I am not shure if this is correct. So I just tryed to input "nvm use lts/*" bevore starting with node-red-start.
Using NVM to manage Node.js + please run nvm use lts/* before running ./node-red
Full Script Output
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED ✔
Remove old version of Node-RED ✔
Using NVM to manage Node.js + please run nvm use lts/* before running ./node-red
Update Node.js LTS ✔ Node v8.11.3 Npm 6.3.0
Clean npm cache ✔
Install Node-RED core ✔ 0.18.7
Move global nodes to local -
Install extra Pi nodes -
Npm rebuild existing nodes ✔
Add menu shortcut ✔
Update systemd script ✔
id=Node-RED.desktop
Any errors will be logged to /var/log/nodered-install.log
All done.
You can now start Node-RED with the command ./node-red
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880
Started Mon Aug 13 19:33:34 CEST 2018 - Finished Mon Aug 13 19:36:59 CEST 2018
node-red-log
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
nodered.service: Start request repeated too quickly.
Failed to start Node-RED graphical event wiring tool.
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
In my last post I added the ouput of the node-red-log, but was not able to finde the problem with it, becaus I don't know what 'exit-code' or "status=127/n/a" should mean.
My apologies, I was expected a bit more output from node-red itself... but this shows it isn't even starting the node process at all. Some there must be something fundamentally off here.
When you run node-red manually (by running the command node-red) - can you share the full log output?
I wonder if there's a permissions issue here with the node-red user directory it is trying to use.
You mean the output direct in the console while starting the process with "node-red"? Here we go.
Sorry if I understand some things wront. I'm about learing all things with linux.
node-redpi@raspberrypi:~ $ node-red
14 Aug 07:54:11 - [info]
Welcome to Node-RED
===================
14 Aug 07:54:11 - [info] Node-RED version: v0.18.7
14 Aug 07:54:11 - [info] Node.js version: v8.11.3
14 Aug 07:54:11 - [info] Linux 4.9.41-v7+ arm LE
14 Aug 07:54:13 - [info] Loading palette nodes
14 Aug 07:54:18 - [info] Dashboard version 2.9.6 started at /ui
14 Aug 07:54:20 - [info] Settings file : /home/pi/.node-red/settings.js
14 Aug 07:54:20 - [info] User directory : /home/pi/.node-red
14 Aug 07:54:20 - [warn] Projects disabled : editorTheme.projects.enabled=false
14 Aug 07:54:20 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
14 Aug 07:54:20 - [info] Server now running at http://127.0.0.1:1880/
14 Aug 07:54:20 - [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.
---------------------------------------------------------------------
14 Aug 07:54:20 - [info] Starting flows
14 Aug 07:54:20 - [info] Started flows
14 Aug 07:54:20 - [info] [mqtt-broker:4de5a62e.392798] Connected to broker: mqtt://localhost:1883
oh maybe I found the problem... I was up to finde out how to update nvm. So I ended up with some thing like "nvm update npm" and got the folowing. By the way, would this be the correct way or do I just update npm with this and not nvm?
...
npm WARN tar ENOENT: no such file or directory, lstat '/tmp/npm-19670-a1a32579/unpack-a4ea40ba/node_modules/yargs'
npm WARN tar ENOENT: no such file or directory, lstat '/tmp/npm-19670-a1a32579/unpack-a4ea40ba/node_modules/yargs'
npm WARN tar ENOENT: no such file or directory, lstat '/tmp/npm-19670-a1a32579/unpack-a4ea40ba/node_modules/yargs'
npm WARN tar ENOENT: no such file or directory, lstat '/tmp/npm-19670-a1a32579/unpack-a4ea40ba/node_modules/yargs'
npm WARN tar ENOENT: no such file or directory, lstat '/tmp/npm-19670-a1a32579/unpack-a4ea40ba/node_modules/yargs'
npm WARN tar ENOENT: no such file or directory, lstat '/tmp/npm-19670-a1a32579/unpack-a4ea40ba/node_modules/yargs'
npm ERR! code ENOSPC
npm ERR! errno -28
npm ERR! syscall write
npm ERR! nospc ENOSPC: no space left on device, write
npm ERR! nospc There appears to be insufficient space on your system to finish.
npm ERR! nospc Clear up some disk space and try again.
* npm upgraded to: v6.3.0
After that I checked the disk space, what shows me the reason. It is full... I just had a 8GB SD Card for my RPi arround.
Or (seeing as you are starting over) - try the Raspbian minimal install version image which does fit well under 8GB, and then install Node-RED directly (without nvm - as per our docs. https://nodered.org/docs/hardware/raspberrypi
set nodered to startup with sudo systemctl enable nodered.service
Installation
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED ✔
Remove old version of Node-RED ✔
Remove old version of Node.js ✔
Install Node.js LTS ✔ Node v8.11.3 Npm 5.6.0
Clean npm cache ✔
Install Node-RED core ✔ 0.19.0
Move global nodes to local -
Install extra Pi nodes -
Npm rebuild existing nodes ✔
Add menu shortcut ✔
Update systemd script ✔
grep: /home/pi/.config/lxpanel/LXDE-pi/panels/panel: No such file or directory
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 Tue 14 Aug 10:03:17 UTC 2018 - Finished Tue 14 Aug 10:07:15 UTC 2018
For what it's worth, I have rpi3B running stretch (Debian) with update and upgrade done. When I did the update to node.js 10.14.2 I encountered exactly the same problem. Every time I run node-red-start it tells me
Node-RED is not yet fully installed
and runs the loop.
Suggested fixes here so far have not helped me. I can run NR by using 1 of 2 commands in the CLI, either ./node-red or node-red. Behaviour is fine using either one however I have to leave the terminal window open and cannot now find any way to get NR to start automatically upon boot or restart.
(Oddity: Not sure why NR states "Node.js version: v6.15.1" when it starts, nvm tells me I am using 10.14.2, but an email node wont run cause it too complains I have to have node.js above v8.)
If node red says it using v6.x in the startup log (which I presume is what you mean) then that is the version it is using. I haven't used nvm so don't know much about it.
On the installation problem, delete the file /var/log/nodered-install.log then run the bash <(curl script and post the install log file here.
Please don't suggest this without the corresponding caveat that this will be remove all npm modules that have been installed - including any installed unrelated to node-red.
When running as a service, it will not pickup any of your nvm environment configuration and will fall back to your system installed node version.
Started : Sun Dec 23 10:41:43 EST 2018
Running for user pi at /home/pi
Found global nodes: :
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 1 not upgraded.
npm WARN deprecated mailparser@0.6.2: Mailparser versions older than v2.3.0 are deprecated
npm WARN deprecated nodemailer@1.11.0: All versions below 4.0.1 of Nodemailer are deprecated. See Status :: Nodemailer
npm WARN deprecated mimelib@0.3.1: This project is unmaintained
npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained
npm WARN deprecated buildmail@2.0.0: This project is unmaintained
/home/pi/.nvm/versions/node/v10.14.2/bin/node-red -> /home/pi/.nvm/versions/node/v10.14.2/lib/node_modules/node-red/red.js
/home/pi/.nvm/versions/node/v10.14.2/bin/node-red-pi -> /home/pi/.nvm/versions/node/v10.14.2/lib/node_modules/node-red/bin/node-red-pi
node-red@0.19.5
updated 1 package in 37.238s
0.19.5
The user pi' is already a member of gpio'.
Finished : Sun Dec 23 10:41:43 EST 2018