I am trying to invoke the installation of node.js on a remote server running Ubuntu via SSH. Node was installed via nvm.
SSHing and calling Node works just fine:
user@localmachine :~$ ssh user@remoteserver (Server welcome text) user@remoteserver :~$ which node /home/user/.nvm/v0.10.00/bin/node
However, if I combine it into one line:
user@localmachine :~$ ssh user@remoteserver "which ls" /bin/ls user@localmachine :~$ ssh user@remoteserver "which node"
No sign of node, so I tried to find .bashrc and wait 10 seconds:
user@localmachine :~$ ssh user@remoteserver "source ~/.bashrc; sleep 10; which node"
This is affected only by Node. One thing I noticed is that if I go down and then check which shell I -bash , and if I'm ssh direct, this gives me /bin/bash . I tried to run commands inside the bash shell:
user@localmachine :~$ ssh user@remoteserver 'bash --login -c "which node"'
Still nothing.
Basically my question is: Why doesn't bash detect my node.js installation when I call it silently from SSH?
source share