can't get node-red to boot automatically on start

5,492 views
Skip to first unread message

Fia Schütz

unread,
Dec 16, 2015, 11:00:13 AM12/16/15
to Node-RED
Help, this is kind of driving me crazy

I have just installed node red on my RPI with Jessie. With the version on the initial image I had no problem with node-red to start on boot. 

But I had to upgrade (for some modules to work) so now I have Node-RED version 0.12.4


sudo systemctl enable nodered.service

 results in "Failed to execute operation: No such file or directory"



https://gist.github.com/Belphemur/3f6d3bf211b0e8a18d93 Doesn't work (getting the same error as in the comments)

PM2 doesn't work that well either...


Not familiar with systemctl and my google-fu seems to be not working as well.

What should I put/do where????

thanks

Dave C-J

unread,
Dec 16, 2015, 11:09:55 AM12/16/15
to node...@googlegroups.com
Hi,
so which version of node.js are you now on ?
Did you uninstall the "old" Node-RED first ? (and node.js ?)
what does   which node      report ?
is there a file called red.js in the  /usr/lib/node_modules/node-red/  directory ?

(sorry for all the questions... - you are sort of in a limbo land between apt-get installing stuff and npm installing stuff... so just trying to work out where you are :-)

Fia Schütz

unread,
Dec 16, 2015, 11:58:23 AM12/16/15
to Node-RED
Yes, it's a limbo, wasn't anything close to this 6 month ago when I did it last time...

these are the commands I run (I save them ;) ) Basically following the instructions on the home page

and running node 4.2.3

sudo apt-get remove nodered
sudo apt-get remove nodejs nodejs-legacy
sudo apt-get remove npm
curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
sudo apt-get install -y build-essential python-dev python-rpi.gpio nodejs
sudo npm install -g --unsafe-perm  node-red
sudo npm install -g npm@2.x

which node reports /usr/bin/node

and yes, I have red.js in /usr/...

thanks, happily answering all questions since it seems I can't figure it out myself :)
Message has been deleted
Message has been deleted

Dave C-J

unread,
Dec 16, 2015, 12:38:12 PM12/16/15
to Node-RED
OK - so actual Node-RED should be OK to run... just the autostart pieces are missing....

If you like you can grab them from github by executing the following
NOTE they are running as sudo so feel free to download manually and move as appropriate instead

sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/nodered.service -O /lib/systemd/system/nodered.service
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-start -O /usr/bin/node-red-start
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-stop -O /usr/bin/node-red-stop
sudo chmod +x /usr/bin/node-red-st*
sudo systemctl daemon-reload

This will get the up to date systemd service starter and the start and stop commands (that are then made executable).
After that it makes the new scripts executable and then refreshes the systemd config so the
sudo systemctl enable nodered.service
should now work...

PS - you are the test subject for this fix :-) When it works I will update the docs.. :-)

Fia Schütz

unread,
Dec 16, 2015, 3:05:37 PM12/16/15
to Node-RED
yes, this is a happy guinea pig :)

your instructions worked  as is, just to cut and paste

thanks a lot

Dave C-J

unread,
Dec 16, 2015, 3:25:14 PM12/16/15
to node...@googlegroups.com
Fia,

excellent - I'll update the docs.
Thanks for reporting it.
Reply all
Reply to author
Forward
0 new messages