Hello I've installed node-red on my macmini m2 running 15.4.1 Sequoia.
Everything is working fine - if is start NR by terminal (cmd node-red) the exec node is working as expected - commands are executed correctly.
But if NR is starting automatically on startup via LaunchAgent script - I'm facing a problem concerning permissions I guess, when I try to execute commands via the exec node.
The commands are not executed I recieve an error 127 e.g. /bin/sh: cp: command not found
Can someone point me to the right direction what I've to do ??
Try using the command which cp
to give you the full path to the command, and put that in the exec node. On my Ubuntu system I see
which cp
/usr/bin/cp
If that doesn't help, how did you install node-red? Is it running in Docker for example? If so then it may be necessary to install cp in the container.
The problem is that when running automatically the PATH environment variable does not exist. I don't use Macs, but I expect that googling for something like How to set an environment variable when starting with LaunchAgent
will help.
Though personally I would just use the full path rather than messing about with env vars.