You can find the particular release you need here
https://nodejs.org/dist/
a given release dir typically lists these :
node-v0.10.15-darwin-x64.tar.gz 25-Jul-2013 23:59
node-v0.10.15-darwin-x86.tar.gz 25-Jul-2013 23:59
node-v0.10.15-linux-arm-pi.tar.gz 12-Aug-2013 20:52
node-v0.10.15-linux-x64.tar.gz 25-Jul-2013 23:59
node-v0.10.15-sunos-x64.tar.gz 25-Jul-2013 23:59
node-v0.10.15-sunos-x86.tar.gz 25-Jul-2013 23:59
node-v0.10.15-x86.msi 25-Jul-2013 23:59
node-v0.10.15.pkg 25-Jul-2013 23:59
node-v0.10.15.tar.gz 25-Jul-2013 23:59
notice various OS specific pre-compiled versions and the source code :
node-v0.10.15.tar.gz
which mentions no OS ... pick either way (binary or source) ... either way you will need to setup environment variables
today let's compile the source code ... expand tarball :
tar xvf node-v0.10.15.tar.gz
cd node-v0.10.15
before compiling do you want to use sudo
to install npm packages later ... or do you prefer to avoid being root and just issue commands as yourself ... if yourself then this works :
# export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
export NODE_PARENT=${HOME}/node-v5.0.0 # Recommended - owned by you NOT root
either way you need these two as well
export PATH=${NODE_PARENT}/bin:${PATH}
export NODE_PATH=${NODE_PARENT}/lib/node_modules
now once above env vars are defined and active in current shell issue
./configure --prefix=${NODE_PARENT}
make
make install
Done ... verify by issuing
node --version
sudo apt-get install nodejs=version
, but the version has to be available. What version of Ubuntu are you on? Are you using a PPA?