Node-red-start not working but node-red working

Hello,

On my pi i've updated form 0.25 to 0.27. i get some bug with the node-red-contrib-serial to i managed to resolve with npm rebuild.

Now, i need to start node-red at boot.

commands:
node-red -> start ok, no error.
node-red-pi -> start ok, no error.
node-red-start -> error:

pi@piUno:~ $ node-red-start
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.1.167: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.or
Starting as a systemd service.
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.
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'.

As node red service use node-red-start command i can't use it to start it on boot up.

Can somebody told my what's the status=127 and why everything is working fine exept this node-red-start. Where's the difference between node-red, node-red-pi and node-red-start ??

Thank you.

Search the forum first.

In one terminal run
tail -f /var/log/syslog
and in another run
node-red-start
The syslog output will probably show you useful error messages. If you don't understand the error then try searching here as suggested, otherwise paste the whole output from syslog, starting with the Welcome to node red message.

can you try which node-red-start and paste the result here please ?

Thank you to all of you for your help.

I've searched the form yesteday all night, but can't seems to find a way to deal with it, that's why i posted here.

I've made some more research based on the tail -f command and the which node.

And it's seems like the node red is trying to start node-red-pi from /usr/bin/env but can't find it.

Aug 22 17:08:08 piUno Node-RED[2720]: /usr/bin/env: « node-red-pi »: Aucun fichier ou dossier de ce type

Which node red command confirm what i was thinking.

$ which node-red-start
 /usr/bin/node-red-start
$ which node-red
/home/pi/.nvm/versions/node/v10.16.3/bin/node-red
$ which node
/home/pi/.nvm/versions/node/v10.16.3/bin/node-red

I will try to delete nvm and use the installation script again without nvm managing my node version.

Ok, i've manage to start node-red with the right node.

This should be added to the doc.

It was an nvm problem. with rm .rf $NVM_DIR

and then running the node-red script again everything started smoothly again.

Thanks

Hmmm a pi start script specific problem I guess... I am able to use an nvm based setup just fine on my development system.

We do say this about nvm in the docs: https://nodered.org/docs/faq/node-versions#using-nvm

But I doubt most users will have read that far before they try installing.

I thought the pi script warned if you were using nvm... or maybe it could.

The script does warn you - but yes could shout louder about the pitfalls.
nvm works fine for starting as the local user - but doesn't support running as a service as the nvm script runs as part of the user shell which the service doesn't have...
EG see this thread - https://github.com/nvm-sh/nvm/issues/745