I often need to play and experiment and using different environments help. In the era of virtualisation we have many options. For this exercise, I'm using Ubuntu Multipass which allow you to vey quickly create virtual machines.
The steps described here will not only install the latest version of Node.js but will also setup the environment to install any global packages in ~/.npm-packages
.
$ multipass launch -n nodejs