Startup script problem

The attached file is a copy of my rc.local. The rc.local script appears to execute as the tightvncserver gets started. However the nodemon process does not start. The element nodemon is a symlink to nodemon and the path is correct.

I have a little start script located in the /home/pi/aws_proxy named start that has the same nohup line but just refers to nodemon not /usr/local/lib/nodemon and that works when I run it.

I just can't understand why it will not run from the rc.local file.

Any help appreciated

Output and error messages are redirected to /home/pi/aws_proxy/aws_proxy.log
Anything in there?

Ahhh. Yes the log file contains:

/usr/bin/env: node: No such file or directory

Which is correct the directory env does not exist in /usr/bin. That brings up the question why is it trying to go there? Is it because /usr/local/bin/nodemon is a symlink?

I am not a linux expert, more than a noobie but not an expert so any help tracking this down would be appreciated.

TIA Barry

---------- Post updated at 05:26 PM ---------- Previous update was at 05:16 PM ----------

While there is no directory named env there is a file so named that seems to be some sort of diagnostic entity. It is binary but there is some text in it that is readable having to do with bad options.

Does that provide more clues?

Something runs

/usr/bin/env ... node

where node is not found.
Perhaps /usr/local/bin/nodemon is a shell script that does it?
Say node is to be found in /usr/local/bin/ then either change the /usr/local/bin/nodemon script to

/usr/bin/env PATH=${PATH}:/usr/local/bin ... node

Or change /etc/rc.local to

nohup /usr/bin/env PATH=${PATH}:/usr/local/bin /usr/local/bin/nodemon --watch /home/pi/aws_proxy/app --watch /home/pi/aws_proxy/ir_library --delay 10 /home/pi/aws_proxy/app/main.js > /home/pi/aws_proxy/aws_proxy.log 2>&1 &

And in this particular case it will also find a simple nodemon in the just defined PATH:

nohup /usr/bin/env PATH=${PATH}:/usr/local/bin nodemon --watch /home/pi/aws_proxy/app --watch  /home/pi/aws_proxy/ir_library --delay 10 /home/pi/aws_proxy/app/main.js  > /home/pi/aws_proxy/aws_proxy.log 2>&1 &