Question: How do I install the latest [node.js](https://nodejs.org) on Ubuntu? I've been looking around, and I can't find anything. Is there a Ubuntu package for `node.js`, or do I have to compile it myself?

Answer: 
[Per the Node.js website](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions-enterprise-linux-fedora-and-snap-packages):

```bash
# Using Debian/Ubuntu
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs            

```

Then, you will have the latest version of Node.js.

If you're not a fan of `curl <url> | bash -`, or are using an unsupported distribution, you can [try a manual installation](https://github.com/nodesource/distributions/blob/master/README.md#debmanual).
Fortunately there is a very easy way of managing your node version, using the Node binary manager module ‘n’.

1: Check your current version of Node.

```
$node -v v0.6.12

```

2: Clear your npm cache

```
sudo npm cache clean -f  

```

3: Install ‘n’

```
sudo npm install -g n  

```

4: Upgrade to a later version (this step can take a while) You can specify a particular version like so:

```
sudo n 0.8.11  

```

Or you can just tell the manager to install the latest stable version like so:

```
sudo n stable  

```

5: Check the running version of Node to verify that it has worked:

```
$node -v v0.8.11

```

If the version doesn’t number output in step 5 isn’t what you were expecting.