I have a deploy script that I want to run from a remote server, if I connect to the server and command manually it works fine:
ssh root@server cd /some-deploy-folder node do-something.js But if I try to do the same by passing it into a single command to ssh:
ssh -t root@localhost <<EOF cd /some-deploy-folder node do-something.js exit EOF Bash is unable to find the node command reporting node: command not found
Is there some reason that passing the EOL commands directly into ssh is not correctly setting up the environment?