$ sudo apt-get install curl python-software-properties
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
$ sudo apt-get install curl python-software-properties
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
$ node -v
v8.11.3
$ npm -v
5.6.0