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

**URL:** https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618
**Category:** General
**Created:** [21 August 2019 21:10 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618 "2019-08-21T21:10:30Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![thomaslc66](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thomaslc66/32/11211_2.png) [@thomaslc66](https://discourse.nodered.org/u/thomaslc66)
#### Post date: [21 August 2019 21:10 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/1 "2019-08-21T21:10:30Z")

</div>

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](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](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.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [21 August 2019 22:34 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/2 "2019-08-21T22:34:10Z")

</div>

[Search the forum first.](https://discourse.nodered.org/search?q=Service%20hold-off%20time%20over%2C%20scheduling%20restart.)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [22 August 2019 08:30 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/3 "2019-08-22T08:30:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [22 August 2019 08:43 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/4 "2019-08-22T08:43:21Z")

</div>

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

---

<div class="post-metadata">

### Author: ![thomaslc66](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thomaslc66/32/11211_2.png) [@thomaslc66](https://discourse.nodered.org/u/thomaslc66)
#### Post date: [22 August 2019 16:15 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/5 "2019-08-22T16:15:19Z")

</div>

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.

```auto
$ 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.

---

<div class="post-metadata">

### Author: ![thomaslc66](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thomaslc66/32/11211_2.png) [@thomaslc66](https://discourse.nodered.org/u/thomaslc66)
#### Post date: [22 August 2019 16:24 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/6 "2019-08-22T16:24:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [22 August 2019 16:51 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/7 "2019-08-22T16:51:33Z")

</div>

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

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [22 August 2019 17:04 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/8 "2019-08-22T17:04:06Z")

</div>

We do say this about nvm in the docs: [https://nodered.org/docs/faq/node-versions#using-nvm](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.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [22 August 2019 21:04 UTC](https://discourse.nodered.org/t/node-red-start-not-working-but-node-red-working/14618/9 "2019-08-22T21:04:55Z")

</div>

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](https://github.com/nvm-sh/nvm/issues/745)
