Install Node.js v4.x via NodeSource[^1] setup script:
sudo -E option indicates to the security policy that the user wishes to preserve their existing environment variables[^2].
Install Node.js v6.x via the same method:
The above installation method has been tested on:
- Debian 8.5
- Node.js v4.4.7 and v6.2.2
In summary, the methods to install Node.js covered are:
- Package manager
- Nodesource script
- From the source
[^1]: NodeSource provides binary distribution setup and support scripts.