nodejs 7 was released and nodesource does an excellent job of creating packages of nodejs for use on many operating systems.
I refuse to curl $URL and pipe the results to bash. It scares me (maybe illogically) to trust a script on the internet with access to my local shell.
The commands without the curl pipe to shell are almost as short and run faster*. It is super easy to get nodejs 7.x installed your ubuntu xenial or yackety system.
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo\ apt-key add - sudo add-apt-repository -u "deb https://deb.nodesource.com/node_7.x $(lsb_release -c -s) main" sudo apt install nodejs
* The apt update command is intentionally skipped. The -u option to add-apt-repository optimizes it to only merge available packages with the newly added repository. This is a bit faster, or a lot faster on older machines or slow cloud instances.