First you'll need to make sure your system has a c++ compiler. For OSX, XCode will work, for Ubuntu, the build-essential and libssl-dev packages work.
To install you could use the install script (requires Git) using cURL:
curl https://raw.github.com/creationix/nvm/master/install.sh | sh