I recently re-installed a PI with NodeJS support and MariaDB support.
NodeJS is not known by apt-get (a strange beta/alpha version is present, version 0.10 or something, not what we want).
I found this guide for the job: http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/
More or less, execute the script located at deb.nodesources using:
curl -sL https://deb.nodesource.com/setup\_7.x | sudo -E bash -
and then proceed with apt-get install
sudo apt-get install nodejs
Simply as that!