How to install NodeJS on Xubuntu 18.04

How to install NodeJS on Xubuntu 18.04

NodeJS is one of the most popular technology for developing web application, you can use nodejs for backend as well as frontend. In this tutorial i'm going to show you how to install the latest nodejs on xubuntu 18.04 bionic.

You can install nodejs in many different ways, but in my opinion the best way to install nodejs and npm is by using nvm (node version manager). Because with nvm you can switch from one version to another easily.

Step by step how to install NodeJS on Xubuntu 18.04
  • run update command
  • sudo apt-get update
  • install build essential
  • sudo apt-get install build-essential
  • install curl
  • sudo apt-get install curl
  • download nvm using curl
  • wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
  • run source ~/.bashrc command
  • source ~/.bashrc
  • test nvm command, make sure it's working
  • nvm -v
  • install node JS (LTS)
  • nvm install --lts
  • done!

To install specific version of nodejs, you can run nvm install followed by the nodejs version that you want, for example if you want to install nodejs 8.11.3 then the command would be like this:
nvm install v8.11.3

Share this

Previous
Next Post »