Can't use nvm from bash script
Here is what worked for me.
First install nvm (once and separately) using SSH or console:
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
Then in your script, loading your profile as follows:
. ~/.nvm/nvm.sh. ~/.profile. ~/.bashrc
And with some luck nvm
should become available inside the script.
nvm install 4.4.2
Tada!